/* GOMGOM compact MY — API-driven wallet and pass surface */

#my {
    background: #fff;
    --my-card-chrome: calc(
        var(--gomgom-header-height) + var(--gomgom-safe-top) +
        var(--gomgom-bottom-nav-height) + var(--gomgom-safe-bottom) + 48px
    );
    --my-card-width: min(300px, calc(min(100dvw, var(--gomgom-app-max-width)) - 2 * var(--gomgom-page-gutter)));
    --my-card-height: clamp(380px, calc(100dvh - var(--my-card-chrome)), 560px);
}

/* ---------- 지갑/이용권/충전 스와이프 카드셋 ---------- */

#my .compact-my-carousel {
    margin: 12px auto 0;
    width: 100%;
}

#my .compact-my-carousel-track {
    display: flex;
    gap: 16px;
    padding-inline: calc((100% - var(--my-card-width)) / 2);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

#my .compact-my-carousel-track::-webkit-scrollbar {
    display: none;
}

#my .compact-my-carousel-track > .compact-my-card,
#my .compact-my-carousel-track > .compact-card-dialog {
    flex: 0 0 auto;
    scroll-snap-align: center;
}

/* ---------- 지갑 카드 (실물 카드 메타포) ---------- */

#my .compact-my-card {
    --my-card-bg: color-mix(in srgb, var(--gomgom-color-coral) 6%, var(--gomgom-color-paper));
    position: relative;
    box-sizing: border-box;
    width: var(--my-card-width);
    height: var(--my-card-height);
    margin: 0;
    padding: 20px 18px 80px;
    display: flex;
    flex-direction: column;
    border-radius: 24px;
}

#my .compact-my-card::before,
#my .compact-card-dialog::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: var(--gomgom-color-coral);
    clip-path: url(#compactMyCardClip);
}

#my .compact-my-card::after {
    content: "";
    position: absolute;
    inset: 1.5px;
    z-index: 0;
    background: var(--my-card-bg);
    clip-path: url(#compactMyCardClip);
}

#my .compact-my-card-badges {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

#my .compact-my-card-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 0 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(17, 17, 17, .92);
    color: #fff;
    font: 800 9.5px/1 Pretendard, sans-serif;
    letter-spacing: -.01em;
    transition: opacity .12s ease, transform .12s ease;
}

#my .compact-my-card-badge:active {
    transform: scale(.95);
    opacity: .6;
}

#my .compact-my-card-badge:disabled {
    background: rgba(17, 17, 17, .35);
}

#my .compact-my-card-fields {
    position: relative;
    z-index: 2;
    margin-top: auto;
    margin-bottom: auto;
    display: flex;
    flex-direction: column;
}

#my .compact-my-card-balance {
    margin-left: 20%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#my .compact-my-card-label {
    color: var(--gomgom-color-muted);
    font-family: Pretendard, sans-serif;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

#my .compact-my-card-time-line {
    display: flex;
    align-items: center;
    gap: 0;
    white-space: nowrap;
}

#my .compact-my-card-time-item {
    display: flex;
    align-items: center;
    gap: 0;
}

#my .compact-my-card-time-icon {
    flex: 0 0 auto;
    width: 13px;
    height: 13px;
    color: rgba(17, 17, 17, .3);
}

#my .compact-my-card-time-value {
    color: var(--gomgom-color-ink);
    font-family: "SF Mono", "Courier New", monospace;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.1em;
}

#my .compact-my-card-time-value.is-muted {
    color: var(--gomgom-color-violet);
    opacity: .8;
}

#my .compact-my-card.is-active .compact-my-card-time-value.is-muted {
    color: var(--gomgom-color-coral);
}

#my .compact-my-card-row {
    margin-left: 20%;
    margin-top: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 22px;
}

#my .compact-my-card-row > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

#my .compact-my-card-ticket-value {
    display: flex;
    align-items: center;
    gap: 2px;
}

#my .compact-my-card-ticket-icon {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    object-fit: contain;
}

#my .compact-my-card-ticket-icon[hidden] {
    display: none;
}

#my .compact-my-card-row strong {
    color: var(--gomgom-color-ink);
    font-size: 12.5px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.01em;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

#my .compact-my-card-row > div:last-child strong {
    font-family: "SF Mono", "Courier New", monospace;
    letter-spacing: .03em;
}

#my .compact-my-card-mark {
    position: absolute;
    z-index: 2;
    right: 17px;
    bottom: 17px;
    display: flex;
}

#my .compact-my-card-mark-img {
    width: 64px;
    height: 64px;
    display: block;
}

/* ---------- 이용권 카드 (구분선 리스트) ---------- */

#my .compact-my-product-list {
    border-top: 1px solid var(--gomgom-color-line);
}

#my .compact-my-product {
    width: 100%;
    min-height: 62px;
    padding: 12px 4px;
    display: flex;
    align-items: center;
    gap: 13px;
    border: 0;
    border-bottom: 1px solid var(--gomgom-color-line);
    background: transparent;
    color: var(--gomgom-color-ink);
    text-align: left;
    transition: background .14s ease;
}

#my .compact-my-product.is-selected {
    background: rgba(119, 80, 248, .05);
}

#my .compact-my-product.is-active {
    background: rgba(255, 107, 97, .05);
}

#my .compact-my-product-icon {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#my .compact-my-product-icon img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

#my .compact-my-product-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

#my .compact-my-product-body strong {
    display: flex;
    align-items: center;
    font-family: Georgia, "Times New Roman", "Noto Serif KR", serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

#my .compact-my-product-special-dot {
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--gomgom-color-coral);
}

#my .compact-my-product-body span {
    color: var(--gomgom-color-muted);
    font-size: 10.5px;
    font-weight: 800;
}

#my .compact-my-product-price {
    flex: 0 0 auto;
    color: var(--gomgom-color-ink);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

#my .compact-my-product.is-selected .compact-my-product-price {
    color: var(--gomgom-color-violet);
}

#my .compact-my-product-price.is-tag {
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255, 107, 97, .14);
    color: var(--gomgom-color-coral);
    font-size: 9.5px;
    letter-spacing: .04em;
}

/* ---------- 하단 선택 확정 바 ---------- */

#my .compact-my-cartbar {
    max-height: 0;
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: max-height .26s ease, margin-top .26s ease, opacity .2s ease, transform .26s ease;
}

#my .compact-my-cartbar.is-open {
    max-height: 76px;
    margin-top: 16px;
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

#my .compact-my-cartbar-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#my .compact-my-cartbar-info span {
    color: var(--gomgom-color-muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

#my .compact-my-cartbar-info strong {
    font-family: Georgia, "Times New Roman", "Noto Serif KR", serif;
    font-size: 15px;
    font-weight: 600;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

#my .compact-my-buy {
    flex: 0 0 auto;
    min-width: 148px;
    min-height: 50px;
    padding: 0 18px;
    border: 0;
    border-radius: 15px;
    background: var(--gomgom-color-violet);
    color: #fff;
    font: 850 13px/1 Pretendard, sans-serif;
    letter-spacing: -.01em;
    transition: transform .12s ease, opacity .12s ease;
}

#my .compact-my-buy:active {
    transform: scale(.97);
    opacity: .88;
}

#my .compact-my-buy:disabled {
    background: var(--gomgom-color-muted);
    opacity: .38;
    transform: none;
}

#my .compact-my-message {
    min-height: 18px;
    margin: 16px 0 0;
    color: var(--gomgom-color-coral);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
}

/* ---------- 이용권 구매 / 충전 카드 ---------- */

#my .compact-card-dialog {
    position: relative;
    box-sizing: border-box;
    width: var(--my-card-width);
    height: var(--my-card-height);
    margin: 0;
    padding: 22px 20px 30px;
    display: flex;
    flex-direction: column;
    overflow: visible;
    border: 0;
}

#my .compact-card-dialog[hidden] {
    display: none;
}

#my .compact-card-dialog::after {
    content: "";
    position: absolute;
    inset: 1.5px;
    z-index: 0;
    background: var(--gomgom-color-paper);
    clip-path: url(#compactMyCardClip);
}

#my .compact-card-dialog > * {
    flex: 0 0 auto;
}

#my .compact-card-dialog .compact-my-product-list,
#my .compact-card-dialog .compact-charge-plans {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

#my .compact-card-dialog h2,
#my .compact-card-dialog .compact-charge-copy,
#my .compact-card-dialog .compact-my-product-list,
#my .compact-card-dialog .compact-charge-wallet,
#my .compact-card-dialog .compact-charge-plans,
#my .compact-card-dialog .compact-charge-primary,
#my .compact-card-dialog .compact-my-message,
#my .compact-card-dialog .compact-my-cartbar,
#my .compact-card-dialog .compact-charge-message {
    position: relative;
    z-index: 1;
}

@media (max-width: 359px) {
    #my .compact-my-buy {
        min-width: 128px;
    }

    #my .compact-my-card-time-line {
        gap: 8px;
    }

    #my .compact-my-card-time-value {
        font-size: 15px;
    }
}

#my .compact-my-account {
    margin-top: 16px;
    border: 1px solid var(--gomgom-color-line, rgba(17, 17, 17, .1));
    border-radius: 20px;
    background: var(--gomgom-color-paper);
    overflow: hidden;
}

#my .compact-my-account-head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border: 0;
    background: none;
    font: 800 13px/1 Pretendard, sans-serif;
    color: var(--gomgom-color-ink);
    letter-spacing: -.01em;
    cursor: pointer;
}

#my .compact-my-account-chevron {
    width: 16px;
    height: 16px;
    color: var(--gomgom-color-muted);
    transition: transform .2s ease;
}

#my .compact-my-account-head[aria-expanded="true"] .compact-my-account-chevron {
    transform: rotate(180deg);
}

#my .compact-my-account-body {
    padding: 0 18px 18px;
}

#my .compact-my-account-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--gomgom-color-line, rgba(17, 17, 17, .08));
    font-size: 12.5px;
}

#my .compact-my-account-row span {
    color: var(--gomgom-color-muted);
}

#my .compact-my-account-row strong {
    color: var(--gomgom-color-ink);
    font-weight: 700;
    text-align: right;
    word-break: break-all;
}

#my .compact-my-account-leave {
    width: 100%;
    margin-top: 14px;
    padding: 12px 0;
    border: 0;
    border-top: 1px solid var(--gomgom-color-line, rgba(17, 17, 17, .08));
    background: none;
    color: var(--gomgom-color-coral);
    font: 700 12.5px/1 Pretendard, sans-serif;
    text-align: center;
    cursor: pointer;
}

#my .compact-my-account-leave:active {
    opacity: .7;
}
