/* ===== 기본 리셋 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #0063F9;
    --primary-dark: #0050C8;
    --primary-light: #EFF2F7;
    --dark: #303030;
    --gray: #696E77;
    --light-gray: #FFFFFF;
    --border: #E8E8E8;
    --white: #FFFFFF;
    --success: #2CB33C;
    --error: #F44242;
    --warning: #F07338;
    --radius: 8px;
}

body {
    font-family: -apple-system, 'Malgun Gothic', sans-serif;
    background: var(--white);
    color: var(--dark);
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

/* ===== 헤더 ===== */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
}

.header-top h1 {
    font-size: 17px;
    font-weight: 700;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--dark);
    padding: 4px 8px;
}

.home-btn {
    font-size: 12px !important;
    color: var(--gray) !important;
    padding: 6px 10px !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px;
}

/* 탭 네비게이션 */
.tab-nav {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.tab {
    flex: 1;
    padding: 12px 0;
    border: none;
    background: none;
    font-size: 14px;
    color: var(--gray);
    cursor: pointer;
    position: relative;
    font-weight: 500;
}

.tab.active {
    color: var(--dark);
    font-weight: 700;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--dark);
}

/* ===== 탭 컨텐츠 ===== */
.tab-content {
    display: none;
    min-height: calc(100vh - 110px);
    padding-bottom: 80px;
}

.tab-content.active {
    display: block;
}

/* ===== 거래처 표시 ===== */
.client-selector {
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    display: none;
}

.client-selector.show {
    display: flex;
    align-items: center;
}

.client-name-badge {
    display: inline-block;
    padding: 6px 14px;
    background: var(--primary);
    color: var(--white);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

/* ===== 검색바 ===== */
.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
}

.purchase-badge {
    background: var(--dark);
    color: var(--white);
    border: none;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.search-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 12px;
    background: var(--white);
}

.search-input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 0;
    font-size: 14px;
}

.search-icon {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
}

/* ===== 고급 필터 패널 ===== */
.advanced-filter {
    padding: 12px 16px 16px;
    background: var(--light-gray);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.advanced-filter.hidden {
    display: none;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: calc(50% - 4px);
}

.filter-row label {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    white-space: nowrap;
    min-width: 40px;
}

.filter-row select {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--white);
    color: var(--dark);
    appearance: auto;
    min-width: 0;
}

.filter-actions {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.filter-reset-btn {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    color: var(--gray);
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-reset-btn:active {
    background: var(--light-gray);
}

/* (덴티스 상품 스타일은 product-specs 등으로 이동됨) */

/* ===== 더보기 버튼 ===== */
.load-more-wrap {
    padding: 16px;
    text-align: center;
}

.load-more-btn {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    font-size: 14px;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.15s;
}

.load-more-btn:active {
    background: var(--light-gray);
}

/* ===== 빈 상태 ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--gray);
}

.empty-state.hidden { display: none; }

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state p {
    text-align: center;
    font-size: 14px;
    line-height: 1.6;
}

/* ===== 카테고리 필터 ===== */
.category-filters {
    display: flex;
    gap: 8px;
    padding: 8px 16px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.category-filters::-webkit-scrollbar { display: none; }

.cat-btn {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--white);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    color: var(--gray);
    transition: all 0.15s;
}

.cat-btn.active {
    background: var(--dark);
    color: var(--white);
    border-color: var(--dark);
}

/* ===== 상품 리스트 ===== */
.search-results.hidden { display: none; }

.list-header {
    display: flex;
    justify-content: space-between;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--gray);
    border-bottom: 1px solid var(--border);
}

.product-list {
    padding: 0;
}

.product-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--light-gray);
    gap: 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.product-item--top {
    align-items: flex-start;
}

.product-item:active {
    background: var(--light-gray);
}

.product-thumb-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.product-mfr-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--white);
    background: var(--dark);
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
    line-height: 1.4;
}

.product-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    overflow: hidden;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    flex: 1;
    min-width: 0;
}

.product-info h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 3px;
    line-height: 1.4;
}

.product-info .meta {
    font-size: 13px;
    color: var(--gray);
}

/* 제조사 + 상품명 + 상품코드 라인 */
.product-sub {
    font-size: 16px;
    color: var(--gray);
    margin-bottom: 3px;
    line-height: 1.4;
}

.product-sub strong {
    color: var(--dark);
    font-weight: 700;
}

.product-model {
    color: var(--dark);
    font-weight: 500;
    font-size: 15px;
}

.product-code {
    color: var(--primary);
    font-weight: 500;
    margin-left: 6px;
    font-size: 12px;
}

/* 스펙 라인 */
.product-specs {
    font-size: 15px;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 2px;
}

/* 호환 */
.product-compat {
    font-size: 12px;
    color: var(--warning);
    margin-bottom: 2px;
}

/* 보험코드 */
.product-insurance {
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 4px;
}

/* ===== 가격 (1줄 표시) ===== */
.price-line {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 4px;
}

.price-original-inline {
    font-size: 12px;
    color: #aaa;
    text-decoration: line-through;
}

.price-discount-rate {
    font-size: 15px;
    font-weight: 800;
    color: var(--error);
}

.price-final {
    font-size: 18px;
    font-weight: 800;
    color: var(--dark);
}

.price-final small {
    font-size: 12px;
    font-weight: 600;
}

/* 기존 호환 (일반 상품용) */
.product-info .discount-price {
    color: var(--error);
    font-weight: 600;
}

.product-info .original-price {
    text-decoration: line-through;
    color: #aaa;
    font-size: 12px;
    margin-left: 4px;
}

.product-info .discount-badge {
    color: var(--error);
    font-size: 12px;
    font-weight: 700;
    margin-right: 4px;
}

.save-btn {
    background: none;
    border: none;
    padding: 8px;
    font-size: 30px;
    cursor: pointer;
    color: #ccc;
    line-height: 1;
    transition: all 0.15s;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.save-btn:hover { color: #f5c518; }
.save-btn.saved { color: #f5c518; }

.add-cart-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
}

.add-cart-btn:active { opacity: 0.6; }

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

/* ===== 즐겨찾기 ===== */
.fav-tab-nav {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.fav-tab {
    flex: 1;
    padding: 10px 0;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    font-size: 13px;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.15s;
}

.fav-tab:active { transform: scale(0.97); }

/* 즐겨찾기 탭 */
.fav-tab--star.active {
    background: #FFF8E1;
    color: #F59E0B;
    border-color: #F59E0B;
}

/* 구매 상품 탭 */
.fav-tab--purchase.active {
    background: #EBF0FF;
    color: var(--primary);
    border-color: var(--primary);
}

.favorites-list {
    padding: 0;
}

/* ===== 구매내역 ===== */
.date-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    flex-wrap: wrap;
}

.date-filter input[type="date"] {
    flex: 1;
    min-width: 0;
    padding: 8px 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
}

.date-filter span {
    color: var(--gray);
}

.date-search-btn {
    background: var(--dark);
    color: var(--white);
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
}

.history-download-btn {
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
}

.history-download-btn:active {
    background: var(--primary-dark);
}

.history-list { padding: 0; }

.history-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--light-gray);
    cursor: pointer;
    transition: background 0.15s;
}

.history-item:active { background: var(--light-gray); }

.history-item .date {
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 4px;
}

.history-item .summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item .items-text {
    font-size: 14px;
    font-weight: 500;
}

.history-item .total-amount {
    font-size: 16px;
    font-weight: 700;
}

.history-item .status {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 6px;
}

.status-pending { background: #FFF3E0; color: var(--warning); }
.status-approved { background: #E8F5E9; color: var(--success); }
.status-confirmed { background: #E3F2FD; color: var(--primary); }
.status-rejected { background: #FFEBEE; color: var(--error); }

/* ===== 통계 (덴딜몰 디자인) ===== */
.stats-content { padding: 0; background: #FFFFFF; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.stats-content > * { min-width: 0; }
.s-summary-card, .s-kpi-row, .s-chart-card, .s-rank-card { min-width: 320px; }
.stats-period-row {
    display: flex; align-items: center; gap: 6px; padding: 12px 16px;
    background: var(--white); border-bottom: 1px solid var(--border);
}
.stats-period-row label { font-size: 13px; font-weight: 600; color: var(--gray); }
.stats-period-row select {
    padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-weight: 600;
}
.stats-summary { display: flex; flex-direction: column; gap: 0; }

/* 요약 카드 */
.s-summary-card {
    margin: 12px 16px; padding: 16px; background: var(--white);
    border-radius: 12px; border: 1px solid #EEE; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.s-summary-title { font-size: 15px; font-weight: 700; color: var(--dark); margin-bottom: 10px; }
.s-summary-row { display: flex; justify-content: space-between; align-items: center; }
.s-summary-amount { display: flex; align-items: baseline; gap: 8px; }
.s-summary-count { font-size: 14px; color: #888; font-weight: 500; }
.s-summary-price { font-size: 22px; font-weight: 800; color: var(--dark); letter-spacing: -0.5px; }
.s-summary-unit { font-size: 16px; font-weight: 700; }
.s-excel-btn {
    display: flex; align-items: center; gap: 4px; padding: 8px 14px;
    background: var(--white); color: #555; border: 1px solid #D0D0D0;
    border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.s-excel-btn:active { background: var(--light-gray); }

/* KPI 카드 */
.s-kpi-row { display: flex; gap: 10px; margin: 0 16px 12px; }
.s-kpi-card {
    flex: 1; padding: 16px 14px; background: var(--white);
    border-radius: 12px; border: 1px solid #EEE; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    position: relative; overflow: hidden;
}
.s-kpi-accent { position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.s-kpi-accent.blue { background: linear-gradient(90deg, #3B5BDB, #748FFC); }
.s-kpi-accent.purple { background: linear-gradient(90deg, #7C3AED, #A78BFA); }
.s-kpi-accent.amber { background: linear-gradient(90deg, #F59E0B, #FBBF24); }
.s-kpi-value { font-size: 22px; font-weight: 800; color: var(--dark); margin-top: 4px; }
.s-kpi-label { font-size: 14px; color: #888; margin-top: 2px; font-weight: 500; }

/* 차트 카드 */
.s-chart-card {
    margin: 0 16px 12px; padding: 16px; background: var(--white);
    border-radius: 12px; border: 1px solid #EEE; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.s-chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.s-chart-title { font-size: 16px; font-weight: 700; color: var(--dark); }
.s-chart-year { font-size: 13px; color: #999; font-weight: 600; }

/* 바 차트 */
.s-bar-chart { display: flex; align-items: flex-end; gap: 3px; height: 110px; }
.s-bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.s-bar-value { font-size: 12px; color: #888; font-weight: 600; white-space: nowrap; }
.s-bar { width: 100%; border-radius: 3px 3px 1px 1px; min-height: 2px; }
.s-bar-label { font-size: 13px; color: #999; }
.s-chart-stats {
    display: flex; justify-content: space-around; margin-top: 10px;
    padding: 8px 0; background: var(--light-gray); border-radius: 8px;
}
.s-chart-stat { text-align: center; }
.s-chart-stat-label { font-size: 13px; color: #888; }
.s-chart-stat-value { font-size: 15px; font-weight: 700; }
.s-chart-stat-value.high { color: #12B886; }
.s-chart-stat-value.low { color: #FA5252; }

/* 카테고리 통계 */
.s-cat-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin-bottom: 12px; }
.s-cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.s-cat-item { display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.s-cat-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.s-cat-name { font-size: 14px; color: #333; flex: 1; }
.s-cat-count { font-size: 13px; color: #888; font-weight: 600; }
.s-cat-percent { font-size: 13px; color: #AAA; }

/* 카테고리별 월별 탭 */
.s-cat-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.s-cat-tab {
    padding: 6px 14px; border-radius: 20px; border: 1px solid #E5E5E5;
    font-size: 12px; font-weight: 600; cursor: pointer; background: var(--white); color: #888;
}
.s-cat-tab.active { background: var(--dark); color: var(--white); border-color: var(--dark); }

/* 순위 카드 */
.s-rank-card {
    margin: 0 16px 12px; background: var(--white);
    border-radius: 12px; border: 1px solid #EEE; box-shadow: 0 1px 4px rgba(0,0,0,0.04); overflow: hidden;
}
.s-rank-header { padding: 16px 16px 12px; }
.s-rank-item { padding: 12px 16px; border-top: 1px solid #F0F0F0; }
.s-rank-row { display: flex; align-items: center; gap: 10px; }
.s-rank-badge {
    width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800;
}
.s-rank-badge.gold { background: linear-gradient(135deg, #FFD43B, #FCC419); color: #5C3D00; }
.s-rank-badge.silver { background: linear-gradient(135deg, #DEE2E6, #CED4DA); color: #495057; }
.s-rank-badge.bronze { background: linear-gradient(135deg, #F59F00, #E8590C); color: var(--white); }
.s-rank-badge.normal { background: #F1F3F5; color: #999; border: 1px solid #E5E5E5; }
.s-rank-info { flex: 1; min-width: 0; }
.s-rank-name { font-size: 15px; font-weight: 600; color: var(--dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-rank-meta { font-size: 10px; color: #AAA; margin-top: 2px; }
.s-rank-values { text-align: right; flex-shrink: 0; }
.s-rank-main { font-size: 15px; font-weight: 700; color: var(--dark); }
.s-rank-sub { font-size: 10px; color: #999; margin-top: 1px; }
.s-rank-bar { margin-top: 6px; margin-left: 38px; }
.s-rank-bar-bg { width: 100%; height: 4px; background: #F1F3F5; border-radius: 2px; overflow: hidden; }
.s-rank-bar-fill { height: 100%; border-radius: 2px; }

/* ===== FAB 장바구니 ===== */
.fab-cart {
    position: fixed;
    bottom: 80px;
    right: calc(50% - 220px);
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 24px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,99,249,0.35);
    z-index: 500;
    transition: transform 0.15s;
}

.fab-cart:active { transform: scale(0.95); }

.cart-badge {
    background: var(--error);
    color: var(--white);
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
    font-weight: 700;
}

.cart-badge.hidden { display: none; }

@media (max-width: 480px) {
    .fab-cart { right: 16px; }
}

/* ===== 모달 (바텀시트) ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px;
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal.hidden { display: none; }

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
}

.modal-sheet {
    position: relative;
    background: var(--white);
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 17px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    color: var(--gray);
}

/* ===== 장바구니 내용 ===== */
.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.cart-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--light-gray);
    position: relative;
}

.cart-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.cart-item-name {
    font-size: 14px;
    font-weight: 600;
    flex: 1;
    padding-right: 20px;
}

.cart-item-remove {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--gray);
    padding: 0;
}

.cart-item-meta {
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 8px;
}

.cart-item-price {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    display: inline-flex;
}

.qty-controls button {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-controls input {
    width: 40px;
    height: 32px;
    border: none;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

.qty-controls input::-webkit-inner-spin-button { -webkit-appearance: none; }

.cart-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--white);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.cart-total span {
    font-size: 14px;
    color: var(--gray);
}

.cart-total strong {
    font-size: 22px;
    font-weight: 700;
}

.cart-actions {
    display: flex;
    gap: 8px;
}

.btn-outline {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    font-size: 13px;
    cursor: pointer;
    color: var(--gray);
    white-space: nowrap;
}

.btn-primary {
    flex: 1;
    padding: 14px 16px;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    font-size: 16px;
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-primary:not(:disabled):active { background: var(--primary-dark); }

.btn-primary.full-width { width: 100%; }

/* ===== 구매 상세 ===== */
.detail-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
}

.detail-row.header {
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
    padding-bottom: 14px;
}

.detail-row .label { color: var(--gray); }
.detail-row .value { font-weight: 600; text-align: right; }

.detail-items-header {
    font-size: 14px;
    font-weight: 700;
    padding: 16px 0 10px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

.detail-product {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--light-gray);
    gap: 10px;
}

.detail-product .product-thumb {
    width: 44px;
    height: 44px;
    font-size: 18px;
}

.detail-product .dp-info { flex: 1; }
.detail-product .dp-info h5 { font-size: 13px; font-weight: 600; }
.detail-product .dp-info p { font-size: 12px; color: var(--gray); }
.detail-product .dp-price { font-size: 14px; font-weight: 600; white-space: nowrap; }

/* ===== 토스트 ===== */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 999;
    animation: toastAnim 2s ease forwards;
    white-space: nowrap;
}

.toast.hidden { display: none; }

@keyframes toastAnim {
    0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* ===== 월별 구매영수증 ===== */
.s-receipt-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 4px 0;
}

.s-receipt-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 6px;
    border-radius: 10px;
    background: var(--light-gray);
}

.s-receipt-item.disabled {
    opacity: 0.4;
}

.s-receipt-month {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
}

.s-receipt-amount {
    font-size: 15px;
    color: var(--gray);
    font-weight: 500;
}

.s-receipt-btn {
    margin-top: 4px;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: var(--primary);
    color: var(--white);
    transition: background 0.15s;
}

.s-receipt-btn:hover {
    background: var(--primary-dark);
}

.s-receipt-btn:disabled {
    background: var(--border);
    color: #aaa;
    cursor: default;
}

/* ===== 즐겨찾기 팝업 ===== */
.fav-popup-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: favFadeIn 0.2s ease;
}

.fav-popup-overlay.hidden { display: none; }

@keyframes favFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes favPopIn {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.fav-popup-box {
    background: var(--white);
    border-radius: 16px;
    padding: 28px 24px 20px;
    width: 280px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    animation: favPopIn 0.25s ease;
}

.fav-popup-icon {
    font-size: 44px;
    margin-bottom: 12px;
    line-height: 1;
}

.fav-popup-icon.add { color: #f5c518; }
.fav-popup-icon.remove { color: #ccc; }

.fav-popup-msg {
    font-size: 15px;
    color: var(--dark);
    line-height: 1.6;
    margin-bottom: 20px;
    word-break: keep-all;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.fav-popup-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--dark);
    text-align: center;
    margin-bottom: 4px;
}

.fav-popup-model {
    font-size: 15px;
    color: var(--primary);
    font-weight: 600;
}

.fav-popup-mfr {
    font-size: 15px;
    color: #444;
    font-weight: 500;
}

.fav-popup-specs {
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.fav-popup-code {
    font-size: 13px;
    color: #777;
}

.fav-popup-price {
    margin-top: 6px;
    font-size: 15px;
}

.fav-popup-price-original {
    color: #999;
    text-decoration: line-through;
    font-size: 14px;
}

.fav-popup-price-rate {
    color: var(--error);
    font-weight: 800;
    font-size: 16px;
}

.fav-popup-price-final {
    font-weight: 800;
    color: var(--dark);
    font-size: 18px;
}

.fav-popup-question {
    text-align: center;
    margin-top: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
}

.fav-popup-buttons {
    display: flex;
    gap: 10px;
}

.fav-popup-cancel,
.fav-popup-confirm {
    flex: 1;
    padding: 12px 0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.15s;
}

.fav-popup-cancel {
    background: var(--light-gray);
    color: var(--gray);
}

.fav-popup-cancel:hover {
    background: var(--border);
}

.fav-popup-confirm {
    background: var(--primary);
    color: var(--white);
}

.fav-popup-confirm:hover {
    background: var(--primary-dark);
}

.fav-popup-confirm.remove {
    background: var(--error);
}

.fav-popup-confirm.remove:hover {
    background: #d63636;
}

/* ===== dendeal.kr 하단바 (foot_nav) ===== */
.foot_nav {
    border-top: 1px solid rgba(0,0,0,0.05);
    height: 60px;
    position: fixed;
    z-index: 1000;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 100%;
    max-width: 480px;
    background: #fff;
    padding: 0;
    display: flex;
    overflow: hidden;
}

.foot_nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    position: relative;
    text-decoration: none;
}

.foot_nav a.on::after {
    content: '';
    width: 24px;
    height: 24px;
    border-radius: 24px;
    position: absolute;
    bottom: -12px;
    background: #0063F9;
    left: 50%;
    transform: translateX(-50%);
}

.foot_nav a i {
    width: 24px;
    height: 24px;
    display: block;
    background-position: center;
    background-repeat: no-repeat;
}

.foot_nav a.f_icon01 i { background-image: url(images/foot01.png); background-size: 22.5px auto; }
.foot_nav a.f_icon02 i { background-image: url(images/foot02.png); background-size: 22.5px auto; }
.foot_nav a.f_icon03 i { background-image: url(images/foot03.png); background-size: 16px auto; }
.foot_nav a.f_icon04 i { background-image: url(images/foot04.png); background-size: 16.5px auto; }
.foot_nav a.f_icon05 i { background-image: url(images/foot05.png); background-size: 16.5px auto; }
.foot_nav a.f_icon06 i { background-image: url(images/foot06.png); background-size: 24.5px auto; }
.foot_nav a.f_icon00 i { background-image: url(images/foot00.png); background-size: 22.5px auto; }

.foot_nav a.f_icon01.on i { background-image: url(images/foot01on.png); }
.foot_nav a.f_icon02.on i { background-image: url(images/foot02on.png); }
.foot_nav a.f_icon03.on i { background-image: url(images/foot03on.png); }
.foot_nav a.f_icon04.on i { background-image: url(images/foot04on.png); }
.foot_nav a.f_icon05.on i { background-image: url(images/foot05on.png); }
.foot_nav a.f_icon06.on i { background-image: url(images/foot06on.png); }

/* 하단바 공간 확보 */
body {
    padding-bottom: 60px !important;
}

/* 홈 버튼 스타일 */
.home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--dark);
}

/* ===== 반응형 ===== */
@media (min-width: 481px) {
    body {
        box-shadow: 0 0 20px rgba(0,0,0,0.08);
    }
}
