/* 단골마켓 — 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;
}
.r2go-seller-intro {
    margin: 0 0 14px;
    padding: 16px 18px;
    border: 1px solid #eadff0;
    border-radius: 14px;
    background: linear-gradient(135deg, #fbf8fd 0%, #fff 72%);
}
.r2go-seller-intro__eyebrow {
    margin: 0 0 5px;
    color: #7a2b91;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
}
.r2go-seller-intro h1 {
    margin: 0;
    color: #29212e;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -.04em;
}
.r2go-seller-intro p:last-child {
    margin: 5px 0 0;
    color: #817887;
    font-size: 12px;
    line-height: 18px;
}

/* —— Header: 로고는 .r2go-app-brand(공통). 검색·카트만 trail —— */
.r2go-market__search {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    min-height: 32px;
    max-height: 32px;
    max-width: 132px;
    width: 100%;
    padding: 0 10px 0 11px;
    box-sizing: border-box;
    align-self: center;
    border-radius: 50px;
    background: #e5e7eb;
    border: 0;
}
.r2go-market__search-input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    font-size: 12px;
    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;
    align-self: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: default;
}
.r2go-market__cart-icon {
    display: block;
    width: 24px;
    height: 24px;
    color: #fff;
}

/* —— 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: #5f0080;
    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: #5f0080;
    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: #5f0080;
    transform: none;
}

.r2go-market__sample-note {
    margin: 0 0 8px;
    font-size: 11px;
    color: var(--r2go-muted);
    text-align: right;
}
.r2go-market__section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin: 8px 0 10px;
}
.r2go-market__section-heading h2 {
    margin: 0;
    color: #2c2334;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.03em;
}
.r2go-market__section-heading span {
    color: #a29aa9;
    font-size: 11px;
}

/* —— 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, #5f0080 0%, #5f0080 100%);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(95, 0, 128, 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: #5f0080;
    color: #fff;
    font-size: 15px;
    font-weight: 400;
    line-height: 24px;
}
.r2go-market__seller-name {
    margin: 0;
    color: #7a2b91;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
}
.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;
}
.r2go-market__empty {
    display: grid;
    gap: 5px;
    margin: 8px 0 0;
    padding: 30px 16px;
    border-radius: 14px;
    background: #faf8fb;
    color: #8b8291;
    text-align: center;
}
.r2go-market__empty strong {
    color: #4b4050;
    font-size: 14px;
    font-weight: 600;
}
.r2go-market__empty span {
    font-size: 11px;
}

/* Figma: 적립률 + 금액P + 최대할인가 + 배송 아이콘 같은 줄 */
.r2go-market__price-row {
    margin-top: 8px;
}
.r2go-market__price-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}
.r2go-market__list-price-wrap {
    display: flex;
    align-items: center;
}
.r2go-market__sale-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}
.r2go-market__sale-wrap {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    white-space: nowrap;
    flex-shrink: 0;
}
.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: #5f0080;
    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:#c64545; font-weight:700; white-space:nowrap; margin-right:3px; }
.r2go-market__earn-box {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    min-width: 0;
}
.r2go-market__earn-note {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 50px;
    padding: 8px 16px 8px 8px;
    border: 1px solid rgba(225, 29, 72, 0.2);
    border-radius: 9999px;
    background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
    box-shadow: 0 2px 6px rgba(225, 29, 72, 0.08);
    color: #e11d48;
    white-space: nowrap;
    box-sizing: border-box;
}
.r2go-market__earn-condition {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 9999px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.2px;
}
.r2go-market__earn-val {
    font-family: Pretendard, "Noto Sans KR", sans-serif;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #e11d48;
    line-height: 1;
}
.r2go-market__earn-unit {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: #e11d48;
    line-height: 1;
}
.r2go-market__earn-note.is-signup-cash {
    border-color: rgba(95, 0, 128, 0.22);
    background: linear-gradient(135deg, #faf5ff 0%, #fff 100%);
    box-shadow: 0 2px 6px rgba(95, 0, 128, 0.08);
    color: #5f0080;
}
.r2go-market__earn-note.is-signup-cash .r2go-market__earn-condition {
    background: #f3e8ff;
    color: #6b21a8;
}
.r2go-market__earn-note.is-signup-cash .r2go-market__earn-val,
.r2go-market__earn-note.is-signup-cash .r2go-market__earn-unit {
    color: #5f0080;
}
.r2go-market__deal-label {
    display: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    color: #5f0080;
    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 {
        margin-top: 4px;
    }
    .r2go-market__price-content {
        gap: 3px;
    }
    .r2go-market__sale-line {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
    }
    .r2go-market__sale-wrap {
        gap: 2px;
    }
    .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: 5px 7px;
        border-radius: 4px;
        font-size: clamp(11px, 3.3vw, 13px);
    }
    .r2go-market__ship-icon {
        width: 18px;
        height: 10px;
    }
    .r2go-market__earn-note {
        min-height: 42px;
        padding: 6px 12px 6px 6px;
        gap: 5px;
    }
    .r2go-market__earn-condition {
        font-size: clamp(10px, 3vw, 11px);
        padding: 3px 6px;
        white-space: nowrap;
    }
    .r2go-market__earn-val {
        font-size: clamp(15px, 4.5vw, 24px);
        letter-spacing: -.4px;
    }
    .r2go-market__earn-unit {
        font-size: clamp(12px, 3.5vw, 15px);
    }
}

/* 원격 브라우저·소형 기기처럼 실사용 폭이 특히 좁은 경우의 안전 기준 */
@media (max-width: 320px) {
    .r2go-market__sale,
    .r2go-market__discount-label {
        font-size: 14px;
    }
    .r2go-market__sale-unit {
        font-size: 12px;
    }
    .r2go-market__earn-condition {
        font-size: 9px;
        padding: 2px 4px;
    }
    .r2go-market__earn-note {
        min-height: 34px;
        padding: 4px 8px 4px 4px;
        gap: 3px;
    }
    .r2go-market__earn-val {
        font-size: 14px;
    }
    .r2go-market__earn-unit {
        font-size: 11px;
    }
}

/* 데스크톱 브라우저의 모바일 프레임도 실제 모바일 카드 밀도와 동일하게 유지한다.
   바깥 브라우저 폭은 600px 이상이어도 앱 프레임 자체는 390px이므로,
   max-width 미디어쿼리만으로는 모바일 축소 규칙이 적용되지 않는다. */
@media (min-width: 600px) {
    body.r2go-app-page:not(.is-intro) .r2go-market__name {
        display: block;
        min-width: 0;
        overflow: hidden;
        font-size: 26px;
        line-height: 1.25;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    body.r2go-app-page:not(.is-intro) .r2go-market__price-row {
        margin-top: 4px;
    }

    body.r2go-app-page:not(.is-intro) .r2go-market__price-content {
        gap: 3px;
    }

    body.r2go-app-page:not(.is-intro) .r2go-market__sale-line {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
    }

    body.r2go-app-page:not(.is-intro) .r2go-market__list-price {
        font-size: 13px;
    }

    body.r2go-app-page:not(.is-intro) .r2go-market__sale,
    body.r2go-app-page:not(.is-intro) .r2go-market__discount-label {
        font-size: 18px;
        letter-spacing: -.4px;
    }

    body.r2go-app-page:not(.is-intro) .r2go-market__sale-unit {
        font-size: 14px;
    }

    body.r2go-app-page:not(.is-intro) .r2go-market__ship {
        gap: 4px;
        padding: 5px 7px;
        border-radius: 4px;
        font-size: 12px;
    }

    body.r2go-app-page:not(.is-intro) .r2go-market__ship-icon {
        width: 18px;
        height: 10px;
    }

    body.r2go-app-page:not(.is-intro) .r2go-market__earn-note {
        min-height: 42px;
        padding: 6px 12px 6px 6px;
        gap: 5px;
    }

    body.r2go-app-page:not(.is-intro) .r2go-market__earn-condition {
        font-size: 11px;
        padding: 3px 6px;
        white-space: nowrap;
    }

    body.r2go-app-page:not(.is-intro) .r2go-market__earn-val {
        font-size: 18px;
        letter-spacing: -.4px;
    }
    body.r2go-app-page:not(.is-intro) .r2go-market__earn-unit {
        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: #5f0080;
    background: #5f0080;
    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;
}
