/* reset */
a{text-decoration: none !important; list-style: none;}
button{font-family: 'Pretendard Variable',sans-serif !important;}

html, body {
    touch-action: manipulation;
    font-family: 'Pretendard Variable', sans-serif !important;
}

/* 로딩바 스타일 */
/* 1. 딤없음 */
.spin {
    width: 18px;
    height: 18px;
    border: 2px solid var(--bd);
    border-top-color: var(--pr);
    border-radius: 50%;
    animation: sp .7s linear infinite;
}
.ldspin {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    color: var(--ts);
    font-size: 12px;
    z-index: 80000;
}
.dots-loader {
    display: flex;
    gap: 8px;
    align-items: center;
}
.dot {
    width: 10px;
    height: 10px;
    background: var(--pr);
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite;
}
.dot:nth-child(1) {
    animation-delay: 0s;
}
.dot:nth-child(2) {
    animation-delay: 0.2s;
}
.dot:nth-child(3) {
    animation-delay: 0.4s;
}
@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* 2. 딤 있음 */
/* 2. 딤 있는 로딩바 (풀스크린) */
.ldspin-dim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 80000;
    align-items: center;
    justify-content: center;
    touch-action: none;
    pointer-events: all;
}
.ldspin-dim.active {
    display: flex;
}
.dots-loader-center {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
.dots-loader-center .dot {
    width: 12px;
    height: 12px;
}

/* 0515ver 로딩 딤 수정 */
.upload-overlay img{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.upload-overlay-dimd{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}
.upload-overlay_spin_wrap{
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.upload-overlay_spin_wrap .spin{
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
.upload-overlay_spin_wrap .text{
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

/* 공통 */
.chips {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    overflow-x: auto;
    /* padding-bottom: 2px; */
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
    cursor: grab;
    user-select: none;
}

.chips:active {
    cursor: grabbing;
}

.chips::-webkit-scrollbar {
    display: none;
}

.chip {
    background: var(--card);
    border: 1px solid var(--bd);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--ts);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: 'Pretendard Variable';
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.chip.on {
    background: var(--black);
    border-color: var(--black);
    color: white;
}

.drow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    position: relative;
}

.dibtn {
    background: var(--card);
    border: 1px solid var(--bd);
    border-radius: 20px;
    padding: 5px 10px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.dibtn.on {
    border-color: var(--black);
    background: var(--black);
}

.dibtn-ico {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: url('/assets/img/icon_daterange.svg') center/contain no-repeat;
    flex-shrink: 0;
}

.dibtn.on .dibtn-ico {
    background-image: url('/assets/img/icon_dateragne_on.svg') center/contain no-repeat;
}

.dlbsm {
    font-size: 11px;
    font-weight: 500;
    /* color: var(--pr); */
    color: #fff;
    display: none;
}

.dibtn.on .dlbsm {
    display: inline;
}

/* drow 기간 설정 활성 상태 */
.drow.on .dibtn {
    background-color: var(--black);
    /* 활성 배경색 — 브랜드 컬러로 변경 */
}

.drow.on .dibtn-ico {
    background-image: url('/assets/img/icon_daterange_on.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.dpop {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--card);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .12);
    z-index: 100;
    min-width: 260px;
    border: 1px solid var(--bd);
}

.dpop.open {
    display: block;
}

.dptitle {
    font-size: 12px;
    font-weight: 700;
    color: var(--ts);
    margin-bottom: 10px;
}

.dprow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.dprow input[type=date] {
    flex: 1;
    border: 1.5px solid var(--bd);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
    font-family: 'Pretendard Variable', sans-serif;
    outline: none;
    background: var(--bg);
}

.dplb {
    font-size: 12px;
    color: var(--ts);
}
.dpbtns {
    display: flex;
    gap: 6px;
}
.dpcbtn {
    flex: 1;
    background: var(--bg);
    border: 1.5px solid var(--bd);
    border-radius: 10px;
    padding: 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Pretendard Variable', sans-serif;
    cursor: pointer;
    color: var(--ts);
}

.dpabtn {
    flex: 1;
    background: var(--pr);
    border: none;
    border-radius: 10px;
    padding: 8px;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Pretendard Variable', sans-serif;
    cursor: pointer;
    color: white;
}
.tm-cat-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}
.tm-cat-btn {
    background: #f5f5f5;
    border: 1.5px solid #EBEBEB;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #8A8A8A;
    cursor: pointer;
    font-family: 'Pretendard Variable', sans-serif;
}
.tm-cat-btn.on {
    background: #0b0b0b;
    border-color: #0b0b0b;
    color: #fff;
}

/* 탭바는 고정시켜서 깜빡임 방지 */
.tabbar {
    view-transition-name: tabbar;
}
.logo, #mainHeader {
    view-transition-name: header;
} */

/* html { scroll-behavior: smooth; } */

body {
    font-family: 'Pretendard Variable', sans-serif;
    background: var(--bg);
    color: var(--tx);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;

    scroll-behavior: smooth;
    overflow-x: hidden;
    overflow-y: scroll;
    scrollbar-width: none;
    -ms-overflow-style: none;

    /* opacity: 0; */
    /* transition: opacity .12s ease; */
}
/* body.loaded { opacity: 1; } */
body::-webkit-scrollbar {
    display: none;
}

/* 헤더 / 탭메뉴 / 모달 공통 스타일*/
header {
    width: 100%;
    max-width: 600px;
    height: 56px;
    padding: 0 16px;
    /* ✅ 상하 패딩 제거, height로 고정 */
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 50;
    position: fixed;
    margin: 0 auto;
    left: 50%;
    transform: translateX(-50%);
}
header::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    right: 0;
    height: 12px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.02), transparent);
    pointer-events: none;
}

/* 탭메뉴 */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background: var(--card);
    border-top: 1px solid var(--bd);
    display: flex;
    padding: 10px 0 20px;
    z-index: 100;
}

.tabi {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    text-decoration: none !important;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.tabico {
    width: 36px;
    height: 36px;
    transition: transform 0.4s;
    background-size: contain !important;
    /* border: 1px solid red; */
}

.tabico.mytag {
    background: url(/assets/img/icon-tag.svg) no-repeat center center;
}

.tabico.shopping {
    background: url(/assets/img/icon-myshopping.svg) no-repeat center center;
}

.tabico.mypage {
    background: url(/assets/img/tapicon_mypage.svg) no-repeat center center;
}

/* active icon */
.tabi.on .tabico.mytag {
    background: url(/assets/img/icon-tag_active.svg) no-repeat center center;
}

.tabi.on .tabico.shopping {
    background: url(/assets/img/icon-myshopping_active.svg) no-repeat center center;
}

.tabi.on .tabico.mypage {
    background: url(/assets/img/tapicon_mypage_active.svg) no-repeat center center;
}

.tablbl {
    font-size: 11px;
    font-weight: 600;
    color: var(--ts);
    text-decoration: none !important;text-decoration-line: none !important;
    -webkit-text-decoration: none !important;
}

.tabi,
.tabi * {
    text-decoration: none !important;
    -webkit-text-decoration: none !important;
}

.tabi.on .tablbl {
    color: var(--black);
}

/* .tabi.on .tabico {
    transform: scale(1.15);
} */

/* 토스트 */
.toast {
    /* left: 50%; */
    /* transform: translateX(-50%) translateY(16px); */
    position: fixed;

    /* 수정된 스타일 */
    left: 0; right: 0;
    margin-inline: auto;
    transform:translateY(16px);
    bottom: 80px;
    
    background: #191919;
    color: white;
    padding: 11px 20px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transition: all .25s;
    z-index: 30000;
    white-space: pre-line;
    /* box-shadow: 0 4px 20px rgba(0, 0, 0, .25); */
    pointer-events: none;
    text-align: center;
    max-width: calc(100vw - 40px);
    width: max-content;
}
.toast.show {
    opacity: 1;
    transform:translateY(0);
    /* transform: translateX(-50%) translateY(0); */
}
.toast.warn {
    background: var(--pr);
    line-height: 1.4;
    white-space: pre-line !important;
    width: max-content;
    max-width: calc(100vw - 40px);
}
.toast.toast-top {
    bottom: auto;
    top: 80px;
    transform: translateY(-16px);
    transition: opacity .25s, transform .25s; /* bottom:auto 전환 애니 제외 */
}
.toast.toast-top.show {
    transform: translateY(0);
}
.toast.toast-modal {
    bottom: auto;
    top: 100px;
    transform: translateY(-16px);
    transition: opacity .25s, transform .25s;
}
.toast.toast-modal.show {
    transform: translateY(0);
}

/* ── 서브페이지 공통 ── */
.subHeader {
    width: 100%;
    max-width: 600px;
    height: 56px;
    /* ✅ 동일하게 고정 */
    padding: 0 16px;
    display: grid;
    grid-template-columns: 32px 1fr 32px;
    align-items: center;
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 50;
    margin: 0 auto;
}

.subHeader::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    right: 0;
    height: 12px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.04), transparent);
    pointer-events: none;
}

.back-btn {
    font-size: 22px;
    color: var(--tx);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 32px;
    flex-shrink: 0;
}

/* sub-title 기준점을 subHeader로 잡으려면 */
.sub-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--tx);
    text-align: center;
}

.back-placeholder {
    width: 32px;
    flex-shrink: 0;
}

.sub-wrap {
    width: 100%;
    max-width: 600px;
    padding: 14px 20px 40px 20px;
    margin: 0 auto;
}











/* 스와이프 드래그 지원 */

/* ── 공통 알럿 모달 ── */
.alert-modal-dim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 20px;
    touch-action: none;
}
.alert-modal-dim.open {
    display: flex;
    animation: dimIn .2s ease both;
}
.alert-modal {
    width: 100%;
    max-width: 300px;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    animation: fadeRise .25s cubic-bezier(.25, .46, .45, .94) both;
    padding: 28px 20px 20px;
    text-align: center;
}
.alert-modal-msg {
    font-size: 15px;
    font-weight: 700;
    color: var(--tx);
    line-height: 1.5;
    margin-bottom: 20px;
}
.alert-modal-btns {
    display: flex;
    gap: 8px;
}
.alert-modal-cancel {
    flex: 1;
    background: #f5f5f5;
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ts);
    cursor: pointer;
    font-family: 'Pretendard Variable', sans-serif;
}
.alert-modal-confirm {
    flex: 1;
    background: var(--pr);
    border: none;
    border-radius: 12px;
    padding: 12px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    font-family: 'Pretendard Variable', sans-serif;
    touch-action: manipulation;
    word-break: keep-all;
}
.alert-modal-confirm:active,
.alert-modal-cancel:active { opacity: .85; }

.route-choice-emph { color: var(--pr); }

/* 이동 경로 선택 알럿 - 상단 캐시백 뱃지 + 닫기 버튼 */
.route-choice-modal { position: relative; padding-top: 32px; }
.route-choice-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f0f0f0;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: var(--ts);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.route-choice-badge-row { justify-content: center; padding: 0 0 10px; }
#routeChoiceMsg { margin-bottom: 4px; }
.route-choice-sub-msg {
    font-size: 12px;
    font-weight: 500;
    color: var(--ts);
    line-height: 1.5;
    margin-bottom: 20px;
}

/* 이동 경로 선택 알럿 - 버튼별 설명 문구가 붙어 세로 스택으로 노출 */
.route-choice-btns { flex-direction: column; }
.route-choice-btn {
    flex: none;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 12px 14px;
}
.route-choice-btn-title { font-size: 14px; }
.route-choice-btn-sub { font-size: 11px; font-weight: 500; opacity: .9; }
.route-choice-btn.warn .route-choice-btn-title { color: var(--tx); }

/* 공지 모달 */
.notice-dim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 300;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.notice-dim.open {
    display: flex;
    animation: noticeDimIn .2s ease both;
}
@keyframes noticeDimIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}
.notice-modal {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 360px;
    overflow: hidden;
    animation: fadeRise .25s cubic-bezier(.25, .46, .45, .94) both;
}
.notice-modal-header {
    padding: 18px 18px 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.notice-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--tx);
    line-height: 1.4;
}
.notice-modal-close {
    width: 28px;
    height: 28px;
    background: #f2f2f2;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.notice-modal-body {
    padding: 10px 18px 20px;
    font-size: 14px;
    color: var(--ts);
    line-height: 1.7;
    height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
}
.notice-modal-footer {
    border-top: 1px solid var(--bd);
    padding: 12px 18px;
    display: flex;
    justify-content: flex-end;
}
.notice-today-btn {
    background: none;
    border: none;
    font-size: 13px;
    color: var(--ts);
    cursor: pointer;
    padding: 4px 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

