/* 단골마켓 — Figma 2166:965 */
.r2go-page--market {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    padding-top: 10px;
    padding-bottom: 28px;
    background: #fff;
}

/* —— Header: 로고는 .r2go-app-brand(공통). 검색·카트만 trail —— */
.r2go-market__search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 33px;
    max-width: 190px;
    width: 100%;
    padding: 0 12px 0 14px;
    border-radius: 50px;
    background: #e5e7eb;
    border: 0;
}
.r2go-market__search-input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    font-size: 13px;
    color: var(--r2go-ink);
    outline: none;
}
.r2go-market__search-input::placeholder {
    color: #9ca3af;
}
.r2go-market__cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: default;
}
.r2go-market__cart-icon {
    display: block;
    width: 28px;
    height: 28px;
}

/* —— Categories H-scroll + 양옆 화살표(첫 방문자 힌트) —— */
.r2go-market__cats-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
    margin: 0 -20px;
    width: calc(100% + 40px);
    max-width: none;
    min-width: 0;
}
.r2go-market__cats {
    display: flex;
    flex-wrap: nowrap;
    flex: 1 1 auto;
    gap: 0;
    margin: 0;
    padding: 0 28px 8px;
    list-style: none;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    cursor: grab;
    scrollbar-width: none;
    user-select: none;
    -webkit-user-select: none;
}
.r2go-market__cats.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
}
.r2go-market__cats::-webkit-scrollbar {
    display: none;
}
.r2go-market__cats-arrow {
    position: absolute;
    top: 0;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 35px;
    margin: 0;
    padding: 0;
    border: 0;
    background: linear-gradient(90deg, #fff 55%, rgba(255, 255, 255, 0));
    color: #3887fe;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.r2go-market__cats-arrow--prev {
    left: 0;
    background: linear-gradient(90deg, #fff 55%, rgba(255, 255, 255, 0));
    border-radius: 0 4px 4px 0;
}
.r2go-market__cats-arrow--next {
    right: 0;
    background: linear-gradient(270deg, #fff 55%, rgba(255, 255, 255, 0));
    border-radius: 4px 0 0 4px;
}
.r2go-market__cats-arrow:disabled,
.r2go-market__cats-arrow.is-hidden {
    opacity: 0.25;
    pointer-events: none;
}
.r2go-market__cats-wrap.is-no-overflow .r2go-market__cats-arrow {
    display: none;
}
.r2go-market__cat {
    flex: 0 0 auto;
}
.r2go-market__cat-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 35px;
    padding: 0 14px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 400;
    line-height: 24px;
    color: #646464;
    white-space: nowrap;
    -webkit-user-drag: none;
    user-select: none;
}
.r2go-market__cat-link.is-active {
    color: #3887fe;
    font-weight: 700;
}
.r2go-market__cat-link.is-active::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 0;
    width: auto;
    height: 3px;
    border-radius: 2px;
    background: #3887fe;
    transform: none;
}

.r2go-market__sample-note {
    margin: 0 0 8px;
    font-size: 11px;
    color: var(--r2go-muted);
    text-align: right;
}

/* —— Promo NOW: 인셋 필 + 문구 순차 전환(마큐 금지) —— */
.r2go-market__promo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    width: 100%;
    max-width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 10px;
    background: linear-gradient(90deg, #1d4ed8 0%, #3887fe 100%);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(56, 135, 254, 0.22);
}
.r2go-market__promo-now {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 22px;
    padding: 0 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
}
.r2go-market__promo-text-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
    height: 24px;
    overflow: hidden;
}
.r2go-market__promo-text {
    position: absolute;
    inset: 0;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 24px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 280ms ease, transform 280ms ease;
    pointer-events: none;
}
.r2go-market__promo-text.is-active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.r2go-market__promo-chevron {
    flex-shrink: 0;
    font-size: 16px;
    opacity: 0.95;
}

/* —— Hero slider —— */
.r2go-market__hero {
    position: relative;
    margin: 0 -20px 0;
    width: calc(100% + 40px);
    max-width: none;
    overflow: hidden;
    aspect-ratio: 440 / 280;
    background: #fff;
    touch-action: pan-y;
    user-select: none;
}
.r2go-market__hero-track {
    display: flex;
    height: 100%;
    width: 100%;
    transition: transform 480ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.r2go-market__hero-slide {
    position: relative;
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    height: 100%;
    padding: 0;
    overflow: hidden;
    color: #fff;
}
.r2go-market__hero-img,
.r2go-market__hero-tone {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}
.r2go-market__hero-img {
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}
.r2go-market__hero-title {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 0 16px 28px;
    font-family: "Gmarket Sans", Pretendard, sans-serif;
    font-size: 22px;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -0.4px;
    white-space: pre-line;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.r2go-market__hero-sub {
    position: relative;
    z-index: 1;
    margin: 8px 0 0;
    padding: 0 16px 28px;
    font-size: 12px;
    opacity: 0.88;
}
.r2go-market__hero-dots {
    position: absolute;
    right: 14px;
    bottom: 12px;
    display: flex;
    gap: 6px;
    z-index: 2;
}
.r2go-market__hero-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    border: 0;
    padding: 0;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: width 200ms ease, background 200ms ease;
}
.r2go-market__hero-dot.is-active {
    width: 16px;
    background: #fff;
}

/* —— Product list (Figma vertical cards) —— */
.r2go-market__list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.r2go-market__item + .r2go-market__item {
    border-top: 8px solid rgba(156, 163, 175, 0.2);
}
.r2go-market__card {
    display: block;
    text-decoration: none;
    color: inherit;
}
.r2go-market__thumb {
    display: block;
    width: calc(100% + 40px);
    margin: 0 -20px;
    aspect-ratio: 440 / 238;
    max-height: 280px;
    object-fit: cover;
    background: #fff;
    font-family: "Gmarket Sans", Pretendard, sans-serif;
    font-size: 22px;
    font-weight: 500;
    color: var(--r2go-primary);
    line-height: 238px;
    text-align: center;
}
img.r2go-market__thumb {
    line-height: 0;
    box-sizing: border-box;
    object-fit: contain;
    object-position: center;
    padding: 20px 28px;
}
.r2go-market__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 0 18px;
}
.r2go-market__badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 27px;
    padding: 0 10px;
    border-radius: 5px;
    background: #3887fe;
    color: #fff;
    font-size: 15px;
    font-weight: 400;
    line-height: 24px;
}
.r2go-market__name {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    color: #111;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Figma: 적립률 + 금액P + 최대할인가 + 배송 아이콘 같은 줄 */
.r2go-market__price-row {
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(132px,1fr);
    gap:12px;
    align-items:end;
    margin-top:8px;
}
.r2go-market__price-main { display:grid; justify-items:start; gap:5px; min-width:0; }
.r2go-market__earn {
    font-family: Pretendard, "Noto Sans KR", sans-serif;
    font-size: 30px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -1.5px;
    color: #3887fe;
    flex-shrink: 0;
}
.r2go-market__sale {
    font-family: Pretendard, "Noto Sans KR", sans-serif;
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    color: #111;
    white-space: nowrap;
    flex-shrink: 0;
}
.r2go-market__sale-unit {
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
    color: #111;
    margin-left: 0;
}
.r2go-market__list-price { font-size:15px; color:#8b94a3; text-decoration:line-through; white-space:nowrap; line-height:1; }
.r2go-market__discount-label { font-size:30px; color:#c50018; font-weight:700; white-space:nowrap; margin-right:3px; }
.r2go-market__earn-box { display:grid; gap:7px; min-width:0; }
.r2go-market__earn-condition { font-size:15px; color:#c50018; font-weight:700; line-height:1; }
.r2go-market__earn-note { display:flex; align-items:center; justify-content:center; min-height:42px; padding:0 10px; border:1px solid #c50018; border-radius:16px; background:#fff7f7; color:#c50018; font-size:30px; font-weight:700; line-height:1; white-space:nowrap; }
.r2go-market__deal-label {
    display: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    color: #3887fe;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 2px;
}
.r2go-market__ship {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 3px 0 0;
    padding:7px 10px;
    border:1px solid #d1d5db;
    border-radius:12px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    color: #646464;
    white-space: nowrap;
    flex-shrink: 0;
}
.r2go-market__ship-icon {
    display: block;
    width: 22px;
    height: 12px;
    object-fit: contain;
    flex-shrink: 0;
}

/* 좁은 회원앱 화면에서도 기준 시안처럼 판매가와 적립을 좌우 2열로 유지한다.
   카드 폭에 맞춰 숫자만 축소하며, 적립 영역을 다음 줄로 내리지 않는다. */
@media (max-width: 560px) {
    .r2go-market__name {
        display: block;
        min-width: 0;
        overflow: hidden;
        font-size: 26px;
        line-height: 1.25;
        white-space: nowrap;
        text-overflow: ellipsis;
        -webkit-line-clamp: unset;
        -webkit-box-orient: initial;
    }
    .r2go-market__price-row {
        grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
        gap: 4px;
        align-items: end;
        margin-top: 4px;
    }
    .r2go-market__price-main {
        gap: 4px;
    }
    .r2go-market__list-price {
        font-size: clamp(11px, 3.5vw, 15px);
    }
    .r2go-market__sale,
    .r2go-market__discount-label {
        font-size: clamp(15px, 4.5vw, 24px);
        letter-spacing: -.4px;
    }
    .r2go-market__sale-unit {
        font-size: clamp(12px, 3.5vw, 16px);
    }
    .r2go-market__ship {
        gap: 4px;
        padding: 6px 8px;
        border-radius: 4px;
        font-size: clamp(11px, 3.3vw, 13px);
    }
    .r2go-market__ship-icon {
        width: 18px;
        height: 10px;
    }
    .r2go-market__earn-box {
        justify-items: stretch;
        gap: 5px;
    }
    .r2go-market__earn-condition {
        font-size: clamp(10px, 3vw, 13px);
        white-space: nowrap;
    }
    .r2go-market__earn-note {
        width: 100%;
        min-height: 38px;
        padding: 0 5px;
        border-radius: 6px;
        font-size: clamp(13px, 4.5vw, 22px);
        letter-spacing: -.35px;
    }
}

/* 원격 브라우저·소형 기기처럼 실사용 폭이 특히 좁은 경우의 안전 기준 */
@media (max-width: 320px) {
    .r2go-market__price-row {
        grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr);
        gap: 4px;
    }
    .r2go-market__sale,
    .r2go-market__discount-label {
        font-size: 14px;
    }
    .r2go-market__sale-unit {
        font-size: 12px;
    }
    .r2go-market__earn-condition {
        font-size: 10px;
    }
    .r2go-market__earn-note {
        min-height: 34px;
        font-size: 13px;
    }
}
.r2go-market__empty {
    margin: 28px 0;
    padding: 28px 16px;
    text-align: center;
    border-radius: 14px;
    background: var(--r2go-surface-soft);
    color: var(--r2go-body);
    font-size: 14px;
}

/* —— Pagination —— */
.r2go-market__pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 20px 0 8px;
    padding: 0;
    list-style: none;
}
.r2go-market__page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #646464;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    line-height: 1;
}
.r2go-market__page.is-active {
    border-color: #3887fe;
    background: #3887fe;
    color: #fff;
    font-weight: 700;
}
.r2go-market__page.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}
.r2go-market__page.is-ellipsis {
    border: 0;
    min-width: 20px;
    padding: 0 2px;
    color: #9ca3af;
    pointer-events: none;
}

/* 세로 스크롤은 shell에서. 스크롤바는 숨김. */
html:has(body.r2go-market-page),
body.r2go-market-page {
    overflow: hidden;
}
body.r2go-market-page .shell {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    /* 공통 fixed 하단 네비와 같은 viewport에서 잘리지 않도록 격리하지 않는다. */
    contain: none;
    background: #fff;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
body.r2go-market-page .shell::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}
