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

html, body {
    touch-action: manipulation;
}

/* 로딩바 스타일 */
/* 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.1);
    z-index: 80000;
    align-items: center;
    justify-content: center;
}
.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;
}

/* 공통 */
.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';
}

.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: 10px;
    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;

    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: sticky;
}
header::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;
}

/* 탭메뉴 */
.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;
}

.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: normal;
    /* 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);
}

/* ── 서브페이지 공통 ── */
.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;
}

.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: 480px;
    padding: 14px 20px 40px 20px;
}











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

/* ── 공통 알럿 모달 ── */
.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;
}
.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;
}
.alert-modal-confirm:active,
.alert-modal-cancel:active { opacity: .85; }

