/* iPhone 17 기본모델 구매 페이지 스타일 */

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    margin: 0;
    color: #1d1d1f;
    background: #ffffff;
    overflow-x: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    width: 100%;
    max-width: 100vw;
}

.container {
    max-width: min(1200px, 100vw);
    margin: 0 auto 20px;
    padding: 0 20px 20px;
    background-color: #fff;
    min-height: calc(100vh - 90px);
    position: relative;
    box-sizing: border-box;
    overflow-x: hidden;
    width: 100%;
}

h1, h2, h3 { color: #1a1a1a; font-weight: 600; }

/* --- 제품 정보 섹션 --- */
.product-info-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.image-gallery {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #F6F5F8;
    border-radius: 10px;
}

.image-gallery img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    border-radius: 10px;
    background-color: #F6F5F8;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin: auto;
}

.product-title { font-size: 2em; margin-bottom: 5px; }
.product-price { font-size: 1.5em; color: #1a1a1a; font-weight: 700; margin-bottom: 20px; }

/* --- 옵션 버튼 공통 --- */
.option-label { font-weight: bold; margin-right: 10px; line-height: 40px; vertical-align: middle; flex-shrink: 0; }
.option-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; flex-grow: 1; }

.option-buttons .option-btn {
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    cursor: pointer;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.9em;
    color: #1d1d1f;
    transition: border-color 0.2s, background-color 0.2s, color 0.2s;
    text-align: center;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    position: relative;
}

.option-buttons .option-btn:hover { background-color: #f5f5f7; border-color: #86868b; }
.option-buttons .option-btn:active { background-color: #e8e8ed; }

.option-buttons .option-btn.sold-out {
    background: #f5f5f5;
    color: #bbb;
    border: 1px solid #e5e5e5;
    cursor: not-allowed;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}
.option-buttons .option-btn.sold-out:hover { background: #f5f5f5; border-color: #e5e5e5; }
.sold-out-badge {
    font-size: 0.7em;
    font-weight: 700;
    color: #ff3b30;
    letter-spacing: 0.5px;
}

.option-buttons .option-btn.active {
    background: #fff;
    color: #1d1d1f;
    border: 2px solid #1d1d1f;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    font-weight: 700;
    border-radius: 8px;
}
.discount-options .option-btn.active {
    background: #f5f5f7;
    border: 2px solid #1d1d1f;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 8px;
}

#discountBtnCardConsult {
    min-width: 140px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: normal;
    word-break: keep-all;
    line-height: 1.2;
    padding: 8px 12px;
}

/* --- 색상 스와치 --- */
.color-options .color-swatch-list { display: flex; flex-wrap: wrap; gap: 10px; }

.color-options .color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.3s, transform 0.2s;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.color-options .color-swatch[style*="background-color: #FCFCFC"]:not(.active) { border: 2px solid #000; }
.color-options .color-swatch:hover { transform: scale(1.1); }
.color-options .color-swatch:active { transform: scale(0.95); }
.color-options .color-swatch.active { border-color: #1d1d1f; box-shadow: 0 0 0 3px rgba(29,29,31,0.15), 0 2px 8px rgba(0,0,0,0.1); }

/* --- 요금제 리스트 --- */
.plan-list .plan-item {
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background-color: #f9f9f9;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 12px;
    position: relative;
}

.plan-list .plan-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.plan-list .plan-item:active { transform: translateY(0) scale(0.98); }
.plan-list .plan-item.active { background: #f5f5f7; border-color: #1d1d1f; box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.plan-list .plan-item h4 { margin: 0 0 10px; font-size: 1.2em; font-weight: 700; color: #1d1d1f; }
.plan-list .plan-item p { margin: 5px 0 0; font-size: 1em; color: #666; font-weight: 600; }
.plan-list .plan-item .plan-text { color: #1d1d1f; font-weight: 700; }

.plan-details { margin: 8px 0 12px; }
.plan-feature { background: #f5f5f7; color: #1d1d1f; padding: 6px 12px; border-radius: 20px; font-size: 0.85em; font-weight: 500; margin: 4px 8px 4px 0; display: inline-block; border: 1px solid #e5e5ea; }

.plan-more-options { background: #f5f5f7 !important; border: 2px dashed #86868b !important; text-align: center; }
.plan-more-options h4 { color: #1d1d1f !important; }
.plan-more-options:hover { background: #e8e8ed !important; }

/* --- 할인 옵션 --- */
.discount-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 20px 0 30px; }
.discount-options .option-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 70px; padding: 12px 16px; border-radius: 8px; border: 1px solid #ddd; background: #f9f9f9; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s; box-shadow: none; font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif; -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; }
.discount-options .option-btn:hover { border-color: #86868b; background: #f5f5f7; }
.discount-options .option-btn .discount-title { font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif; font-size: 0.9em; font-weight: 500; color: #555; line-height: 1.3; white-space: nowrap; }
.discount-options .option-btn.active .discount-title { color: #1d1d1f; font-weight: 600; }
.discount-options .option-btn .total-discount-amount { display: block; margin-top: 6px; font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif; font-size: 1.25em; font-weight: 700; color: #e6007e; line-height: 1.3; white-space: nowrap; }
.discount-options .option-btn.active .total-discount-amount { color: #e6007e; }
.discount-options .option-btn:focus { outline: none; }
.discount-options .option-btn:active { background: #e8e8ed; }


/* --- 결합할인 옵션 --- */
.bundle-discount-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.bundle-discount-options .option-btn { min-height: 48px; padding: 12px 16px; border-radius: 8px; border: 1px solid #ddd; background: #f9f9f9; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s; font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif; font-size: 1em; font-weight: 500; color: #1d1d1f; text-align: center; -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; }
.bundle-discount-options .option-btn:hover { border-color: #86868b; background: #f5f5f7; }
.bundle-discount-options .option-btn.active { background: #fff; color: #1d1d1f; border: 2px solid #1d1d1f; box-shadow: 0 2px 8px rgba(0,0,0,0.06); font-weight: 700; border-radius: 8px; }
.bundle-discount-options .option-btn:active { background: #e8e8ed; }
.bundle-discount-info { margin-top: 8px; padding: 8px 12px; background: #f5f5f7; border-radius: 6px; font-size: 0.85em; color: #86868b; text-align: center; }

/* --- 섹션 간격 --- */
.purchase-options-section + .purchase-options-section { margin-top: 32px; padding-top: 24px; border-top: 1px solid #eee; }
.option-group { margin-bottom: 28px; }
.option-group + .option-group { margin-top: 32px; padding-top: 16px; border-top: 1px solid #f5f5f5; }

/* --- 명세서 --- */
.final-price-box { background: #f5f5f7; border: none; border-radius: 16px; padding: 24px; margin: 24px 0 32px; box-shadow: none; }
.price-receipt { background: #fff; border-radius: 12px; padding: 24px; border: none; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.receipt-header { text-align: left; font-size: 1.15em; font-weight: 700; color: #1d1d1f; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 2px solid #1d1d1f; letter-spacing: -0.02em; }

#receiptDetails { min-height: 180px; transition: all 0.3s ease; overflow: hidden; }

.receipt-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #f0f0f0; font-size: 0.95em; }
.receipt-item:last-child { border-bottom: none; }
.receipt-item .item-label { color: #86868b; font-weight: 400; font-size: 0.9em; }
.receipt-item .item-value { color: #1d1d1f; font-weight: 600; font-size: 0.95em; }

.receipt-total { margin-top: 16px; padding-top: 16px; border-top: 1px solid #d2d2d7; display: flex; justify-content: space-between; align-items: center; }
.receipt-total .total-label { font-size: 1.1em; font-weight: 700; color: #1d1d1f; }
.receipt-total .total-amount { font-size: 1.5em; font-weight: 800; color: #1d1d1f; }

/* --- 고객정보 입력 --- */
.customer-info-section .input-group,
.address-input-group { display: flex; gap: 8px; margin-bottom: 10px; flex-direction: column; }

.customer-info-section .input-group input,
.address-input-group input {
    flex-grow: 1;
    padding: 14px 16px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 16px;
    height: 52px;
    box-sizing: border-box;
    background: #fafbfc;
    transition: all 0.2s;
    color: #1d1d1f;
}

.customer-info-section .input-group input:focus,
.address-input-group input:focus {
    outline: none;
    border-color: #1d1d1f;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(29,29,31,0.08);
}

.address-input-group button {
    padding: 14px 20px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    height: 52px;
    box-sizing: border-box;
    background: linear-gradient(135deg, #fff, #f8f9fa);
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #1d1d1f;
    transition: all 0.2s;
}

.address-input-group button:hover { background: linear-gradient(135deg, #f8f9fa, #e9ecef); transform: translateY(-1px); }

/* --- 구매 버튼 --- */
.btn-purchase {
    width: 100%;
    padding: 16px 20px;
    margin-top: 20px;
    background: linear-gradient(135deg, #e6007e 0%, #d4006e 40%, #b80060 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.3em;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(230,0,126,0.35), 0 2px 6px rgba(0,0,0,0.1);
    transition: all 0.3s;
    min-height: 56px;
    position: relative;
    overflow: hidden;
}

.btn-purchase::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s;
}
.btn-purchase:hover::before { left: 100%; }

.btn-purchase:hover:not(:disabled) { background: linear-gradient(135deg, #ff1a8c, #e6007e, #c9006d); transform: translateY(-3px) scale(1.01); box-shadow: 0 14px 40px rgba(230,0,126,0.45), 0 4px 10px rgba(0,0,0,0.12); }
.btn-purchase:disabled { background: #e5e5ea; color: #8e8e93; cursor: not-allowed; box-shadow: none; }

/* --- 사은품 --- */
.freebies-section { background: #f5f5f7; border: 1px solid #e5e5ea; border-radius: 14px; padding: 20px; margin-bottom: 20px; }
.freebies-section h2 { color: #1a1a1a; font-weight: 600; margin-bottom: 15px; font-size: 1.3em; }

.gift-items-row { display: flex; gap: 12px; padding: 20px; background: linear-gradient(135deg, #fff, #f8f9fa); border-radius: 8px; overflow-x: auto; scrollbar-width: none; min-height: 100px; align-items: center; }
.gift-items-row::-webkit-scrollbar { display: none; }

.gift-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; background: linear-gradient(135deg, #fff, #f8f9fa); border-radius: 10px; border: 1px solid #e9ecef; box-shadow: 0 2px 6px rgba(0,0,0,0.08); min-width: 85px; flex-shrink: 0; }
.gift-item:hover { border-color: #86868b; transform: translateY(-2px); }
.gift-item img { width: 50px; height: 50px; object-fit: cover; border-radius: 8px; background-color: #f8f9fa; }
.gift-item span { font-size: 0.8em; font-weight: 600; color: #1a1a1a; text-align: center; white-space: nowrap; }

/* --- 팝업 공통 --- */
.custom-popup-overlay {
    display: none !important;
    position: fixed !important;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    z-index: 2147483647 !important;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-popup-overlay.show {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.custom-popup-overlay[style*="display: flex"] {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.custom-popup { background-color: #fff; padding: 25px; border-radius: 12px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); max-width: 90%; width: 400px; text-align: center; margin: auto; animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

.popup-buttons { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 20px 0 0; }
.popup-buttons button { padding: 16px 20px; border: none; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer; min-height: 56px; display: flex; align-items: center; justify-content: center; }
.popup-btn-confirm { background: linear-gradient(135deg, #e6007e 0%, #d4006e 40%, #b80060 100%) !important; color: white !important; box-shadow: 0 2px 8px rgba(230,0,126,0.25) !important; }
.popup-btn-cancel { background: linear-gradient(135deg, #f5f5f7, #e8e8e8) !important; color: #1d1d1f !important; }

/* --- 요금제 팝업 (모달) --- */
.plan-popup-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.45);
    z-index: 2147483647;
    justify-content: center;
    align-items: center;
    padding: 24px;
    box-sizing: border-box;
}
.plan-popup-overlay.show { display: flex; }

.plan-popup-fullscreen {
    display: flex; flex-direction: column;
    width: 100%; max-width: 760px;
    height: 80vh; max-height: 80vh;
    background: #fff; border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.18);
    overflow: hidden;
    overscroll-behavior: contain;
}
.plan-popup-topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 20px; border-bottom: 1px solid #e5e5e5;
    background: #fff; flex-shrink: 0;
    line-height: 1.2; box-sizing: border-box;
}
.plan-popup-topbar h3 {
    margin: 0; padding: 0;
    font-size: 1.05em; font-weight: 700; color: #1d1d1f;
    line-height: 1.2;
}
.plan-popup-close-btn {
    background: none; border: none;
    width: 32px; height: 32px;
    cursor: pointer; color: #333; font-size: 20px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: background 0.2s;
    padding: 0;
}
.plan-popup-close-btn:hover { background: #f5f5f5; }

.plan-popup-body { display: flex; flex: 1; overflow: hidden; min-height: 0; }

.plan-filter-sidebar {
    width: 220px; min-width: 220px; flex-shrink: 0; border-right: 1px solid #e5e5e5;
    padding: 20px 16px; overflow-y: auto; background: #fafafa;
    box-sizing: border-box; overscroll-behavior: contain;
}
.filter-section { margin-bottom: 18px; }
.filter-section h4 { font-size: 0.88em; font-weight: 700; color: #1d1d1f; margin: 0 0 10px; }
.filter-header-toggle { display: flex; justify-content: space-between; align-items: center; cursor: pointer; margin-bottom: 12px; }
.filter-header-toggle h4 { margin: 0; }
.toggle-arrow { transition: transform 0.2s; }

.filter-search-box {
    position: relative;
}
.filter-search-box input {
    width: 100%; padding: 10px 36px 10px 12px; border: 1px solid #ddd;
    border-radius: 8px; font-size: 14px !important; background: #fff;
    box-sizing: border-box; outline: none; transition: border 0.2s;
}
.filter-search-box input:focus { border-color: #1d1d1f; }
.filter-search-box .search-icon { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }

.filter-options { display: flex; flex-direction: column; gap: 4px; }
.filter-radio {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px;
    border-radius: 10px; cursor: pointer; font-size: 0.84em; color: #555;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    user-select: none; background: #f7f7f8;
    border: 1.5px solid transparent;
    font-weight: 500;
}
.filter-radio:hover { background: #efefef; }
.filter-radio.active { color: #1d1d1f; background: #f0f0f0; border-color: #1d1d1f; font-weight: 600; }
.radio-dot {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid #ccc; position: relative; flex-shrink: 0;
    transition: border-color 0.15s; background: #fff;
}
.filter-radio.active .radio-dot { border-color: #1d1d1f; }
.filter-radio.active .radio-dot::after {
    content: ''; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 8px; height: 8px; border-radius: 50%; background: #1d1d1f;
}

.filter-price-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.filter-price-btn {
    padding: 8px 4px; border: 1.5px solid #e5e5e5; border-radius: 20px;
    background: #f7f7f8; color: #555; font-size: 0.8em !important; font-weight: 500;
    cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-align: center; white-space: nowrap;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
}
.filter-price-btn:hover { background: #efefef; border-color: #ccc; }
.filter-price-btn.active { background: #fff; border-color: #1d1d1f; color: #1d1d1f; font-weight: 700; }

.plan-popup-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.plan-sort-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 18px; border-bottom: 1px solid #eee;
    background: #fff; flex-shrink: 0;
    line-height: 1.2; box-sizing: border-box;
}
.plan-result-count {
    font-size: 0.85em; color: #888;
    margin: 0; padding: 0; line-height: 1.2;
}
.plan-sort-select-wrap select {
    padding: 3px 28px 3px 10px; border: 1px solid #e0e0e0; border-radius: 6px;
    font-size: 13px; color: #333; background: #fff;
    cursor: pointer; outline: none;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 500; letter-spacing: -0.02em;
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23666' d='M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
    padding-right: 30px;
}

.plan-list-cards { flex: 1; overflow-y: auto; padding: 14px 18px; -webkit-overflow-scrolling: touch; }

.plan-card-item {
    border: 1px solid #e8e8e8; border-radius: 10px; padding: 16px 18px;
    margin-bottom: 10px; cursor: pointer; background: #fff;
    transition: all 0.2s ease; position: relative;
}
.plan-card-item:hover { border-color: #86868b; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.plan-card-item:active { transform: scale(0.995); }
.plan-card-item.selected { border-color: #1d1d1f; background: #f5f5f7; }

.plan-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.plan-card-name-area { flex: 1; }
.plan-card-badge {
    display: inline-block; padding: 3px 10px; border-radius: 4px;
    font-size: 0.75em; font-weight: 700; color: #fff; margin-bottom: 6px;
}
.plan-card-badge.popular { background: #e6007e; }
.plan-card-badge.premium { background: #7b61ff; }
.plan-card-badge.youth { background: #00b894; }
.plan-card-badge.kids { background: #fdcb6e; color: #333; }
.plan-card-badge.senior { background: #74b9ff; }
.plan-card-badge.teen { background: #fd79a8; }

.plan-card-name {
    font-size: 1em; font-weight: 700; color: #1d1d1f; margin: 0 0 4px;
    display: flex; align-items: center; gap: 6px;
}
.plan-card-name .arrow { color: #ccc; font-size: 0.8em; }
.plan-card-data { font-size: 0.9em; color: #555; margin: 2px 0; }
.plan-card-data strong { color: #1d1d1f; font-weight: 700; }
.plan-card-tethering { font-size: 0.82em; color: #888; margin: 2px 0; }

.plan-card-price-area { text-align: right; flex-shrink: 0; margin-left: 16px; }
.plan-card-original-price {
    font-size: 0.85em; color: #aaa; text-decoration: line-through; margin-bottom: 2px;
}
.plan-card-discount-price {
    font-size: 1.3em; font-weight: 800; color: #1d1d1f;
}
.plan-card-discount-price .won { font-size: 0.75em; font-weight: 600; }

.plan-card-select-btn {
    display: none; width: 100%; margin-top: 14px; padding: 12px;
    background: linear-gradient(135deg, #e6007e 0%, #d4006e 40%, #b80060 100%); color: #fff; border: none; border-radius: 8px;
    font-size: 15px !important; font-weight: 700; cursor: pointer;
    transition: background 0.2s;
}
.plan-card-item.selected .plan-card-select-btn { display: block; }
.plan-card-select-btn:hover { background: linear-gradient(135deg, #ff1a8c, #e6007e, #c9006d); }

.plan-no-results {
    text-align: center; padding: 60px 20px; color: #999; font-size: 1em;
}

.plan-filter-toggle-mobile {
    display: none; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    padding: 12px 24px; background: linear-gradient(135deg, #e6007e 0%, #d4006e 40%, #b80060 100%); color: #fff; border: none;
    border-radius: 24px; font-size: 15px !important; font-weight: 600;
    cursor: pointer; box-shadow: 0 4px 16px rgba(230,0,126,0.3);
    z-index: 10; gap: 6px; align-items: center;
}

@media (max-width: 767px) {
    /* === 팝업 전체 레이아웃 === */
    .plan-popup-overlay { padding: 0; }
    .plan-popup-fullscreen {
        max-width: 100%; max-height: 100%;
        height: 100%; border-radius: 0;
        overflow-y: auto; overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
    .plan-popup-body { display: block; overflow: visible; }
    .plan-popup-main { overflow: visible; }

    /* === 상단바 + 정렬바: 모바일 sticky === */
    .plan-popup-topbar { position: sticky; top: 0; z-index: 10; padding: 10px 16px; }
    .plan-sort-bar { position: sticky; top: 0; z-index: 9; padding: 6px 14px; }
    .plan-result-count { font-size: 0.82em; }
    .plan-sort-select-wrap select { font-size: 13px; }

    /* === 요금제 카드 목록 === */
    .plan-list-cards { padding: 10px 12px; overflow: visible; padding-bottom: 80px; }
    .plan-card-item { padding: 14px 14px; margin-bottom: 10px; border-radius: 10px; }
    .plan-card-top { flex-direction: row; align-items: flex-start; }
    .plan-card-price-area { text-align: right; margin-left: auto; margin-top: 0; }
    .plan-card-original-price { font-size: 0.8em; }
    .plan-card-discount-price { font-size: 1.15em; }
    .plan-card-name { font-size: 0.95em; }
    .plan-card-data { font-size: 0.82em; }
    .plan-card-tethering { font-size: 0.78em; }
    .plan-card-select-btn { padding: 10px; font-size: 14px; margin-top: 10px; min-height: 44px; }

    /* === 필터 바텀시트 === */
    .plan-filter-sidebar {
        display: none;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        top: auto;
        width: 100%; min-width: 0;
        height: auto; max-height: 65vh;
        z-index: 200;
        border-right: none;
        border-radius: 20px 20px 0 0;
        padding: 20px 20px 30px;
        background: #fff;
        box-shadow: 0 -12px 40px rgba(0,0,0,0.12);
        overflow-y: auto; overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        transform: translateY(0);
    }
    @keyframes slideUpFilter {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
    .plan-filter-sidebar.show { display: block; animation: slideUpFilter 0.25s ease-out; }
    .plan-filter-sidebar::before {
        content: '';
        display: block;
        width: 40px; height: 4px;
        background: #d1d1d6;
        border-radius: 2px;
        margin: 0 auto 18px;
    }

    /* === 필터 오버레이 + 닫기 === */
    .plan-filter-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100%;
        background: rgba(0,0,0,0.35);
        z-index: 199;
    }
    .plan-filter-sidebar-overlay.show { display: block; }

    .plan-filter-close-mobile {
        display: flex;
        position: absolute;
        top: 14px; right: 14px;
        width: 36px; height: 36px;
        background: #f2f2f7;
        border: none; border-radius: 50%;
        align-items: center; justify-content: center;
        cursor: pointer;
        font-size: 16px; color: #8e8e93;
        z-index: 201;
    }

    /* === 필터 내부 요소 === */
    .filter-section { margin-bottom: 20px; }
    .filter-section h4 { font-size: 0.85em; color: #8e8e93; text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 10px; }
    .filter-radio { padding: 10px 12px; font-size: 0.85em; min-height: 44px; border-radius: 10px; }
    .filter-price-btn { padding: 10px 6px; font-size: 0.82em !important; min-height: 40px; }
    .filter-price-buttons { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .filter-search-box input { height: 44px; font-size: 15px !important; border-radius: 10px; }
    .filter-options { gap: 6px; }

    /* === 필터 토글 버튼 === */
    .plan-filter-toggle-mobile { display: flex; }
}

@media (min-width: 768px) {
    .plan-filter-toggle-mobile { display: none; }
    .plan-filter-close-mobile { display: none; }
    .plan-filter-sidebar-overlay { display: none; }
}

/* --- 제휴카드 팝업 --- */
.custom-popup-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 100;
    align-items: center; justify-content: center;
}
.card-popup {
    display: flex; flex-direction: column;
    width: 100%; max-width: 700px;
    height: 80vh; max-height: 80vh;
    background: #fff; border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.18);
    overflow: hidden;
    overscroll-behavior: contain;
}
.custom-popup-overlay.show .card-popup { opacity: 1; }
.card-popup-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 20px; border-bottom: 1px solid #e5e5e5;
    background: #fff; flex-shrink: 0;
    line-height: 1.2; box-sizing: border-box;
}
.card-popup-header h3 {
    margin: 0; padding: 0;
    font-size: 1.05em; font-weight: 700; color: #1d1d1f;
    line-height: 1.2;
}
.card-popup-close {
    background: none; border: none;
    width: 32px; height: 32px;
    cursor: pointer; color: #333; font-size: 20px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: background 0.2s;
    padding: 0;
}
.card-popup-close:hover { background: #f5f5f5; }
.card-popup-content {
    flex: 1; overflow-y: auto; padding: 18px;
    -webkit-overflow-scrolling: touch;
}
.card-category h4 {
    margin: 0 0 14px; font-size: 0.95em; font-weight: 700;
    padding-bottom: 8px; border-bottom: 2px solid #1d1d1f;
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.card-card {
    border: 1px solid #e8e8e8; border-radius: 10px;
    padding: 16px 18px; background: #fff; cursor: pointer;
    transition: all 0.2s ease; position: relative;
}
.card-card:hover { border-color: #86868b; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.card-card.selected { border-color: #1d1d1f; background: #f5f5f7; }
.card-badge {
    position: absolute; top: -8px; right: 15px;
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    color: white; padding: 3px 10px; border-radius: 10px;
    font-size: 0.72em; font-weight: 700;
}
.card-card h5 { margin: 0 0 8px; font-size: 0.95em; font-weight: 700; color: #1d1d1f; }
.card-price { font-size: 0.85em; font-weight: 600; color: #555; margin-bottom: 10px; line-height: 1.4; }
.card-specs { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.spec-item {
    font-size: 0.78em; color: #888; background: #f5f5f5;
    padding: 3px 8px; border-radius: 4px;
}


/* iOS Safari 자동 확대 방지 - 입력 필드만 적용 */
.customer-info-section input,
.customer-info-section select,
.customer-info-section textarea,
.address-input-group input,
.filter-search-box input { font-size: 16px !important; }

/* --- 모바일 반응형 --- */
@media (max-width: 767px) {
    body { width: 100%; max-width: 100vw; overflow-x: hidden; }
    .container { max-width: 100vw; margin: 0; padding: 0 14px 20px; width: 100%; box-sizing: border-box; overflow-x: hidden; }
    .product-info-section { flex-direction: column; gap: 12px; padding: 10px 0 16px; }
    .image-gallery { width: 100%; height: 260px; border-radius: 12px; }
    .image-gallery img { width: 100%; max-width: 100%; min-height: 180px; max-height: 300px; border-radius: 8px; }

    .product-title { font-size: 1.4em; line-height: 1.3; margin-bottom: 6px; }
    .product-price { font-size: 1.15em; margin-bottom: 14px; }

    .option-label { margin-bottom: 8px; width: 100%; font-size: 0.92em; }
    .option-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; width: 100%; }
    .option-buttons .option-btn {
        padding: 12px 8px;
        font-size: 0.88em;
        min-height: 44px;
        border-radius: 10px;
    }

    #capacityButtons { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; width: 100%; }
    #capacityButtons .option-btn { white-space: nowrap; min-width: 70px; font-size: 0.85em; padding: 10px 8px; min-height: 44px; }

    .color-options .color-swatch { width: 38px; height: 38px; }

    .discount-options {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin: 16px 0 24px;
    }
    .discount-options .option-btn {
        min-height: 60px;
        padding: 10px 8px;
        border-radius: 10px;
    }
    .discount-options .option-btn .discount-title { font-size: 0.95em; }
    .discount-options .option-btn .total-discount-amount { font-size: 1.1em; margin-top: 4px; }

    .plan-list .plan-item { padding: 14px; margin-bottom: 10px; border-radius: 10px; }
    .plan-list .plan-item h4 { font-size: 1.05em; margin-bottom: 6px; }
    .plan-list .plan-item p { font-size: 0.9em; }
    .plan-feature { font-size: 0.78em; padding: 5px 10px; margin: 3px 4px 3px 0; }

    .purchase-options-section + .purchase-options-section { margin-top: 32px; padding-top: 20px; }
    .option-group { margin-bottom: 28px; }
    .option-group + .option-group { margin-top: 28px; padding-top: 16px; border-top: 1px solid #f0f0f0; }

    .address-input-group { flex-direction: column; width: 100%; }
    .address-input-group button { width: 100%; margin-top: 8px; min-height: 48px; }
    .customer-info-section .input-group input,
    .address-input-group input { height: 48px; font-size: 15px; padding: 12px 14px; }

    .final-price-box { margin: 12px -14px 20px; border-radius: 0; padding: 18px 16px; }
    .receipt-item { font-size: 0.85em; padding: 6px 0; }
    .receipt-total .total-label { font-size: 1em; }
    .receipt-total .total-amount { font-size: 1.2em; }

    .btn-purchase { font-size: 1.1em; padding: 14px 16px; min-height: 52px; border-radius: 12px; margin-top: 16px; }

    .freebies-section { padding: 16px; margin-bottom: 16px; }
    .gift-items-row { padding: 12px; gap: 10px; }
    .gift-item { min-width: 75px; padding: 10px 8px; }

    .custom-popup-overlay { align-items: stretch; justify-content: stretch; padding: 0; }
    .card-popup {
        width: 100%; max-width: 100%;
        height: 100%; max-height: 100%;
        border-radius: 0;
        overflow-y: auto; overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
    .card-popup-header {
        padding: 10px 16px;
        position: sticky; top: 0; z-index: 10;
        background: #fff; border-bottom: 1px solid #e5e5e5;
    }
    .card-popup-header h3 { font-size: 1em; }
    .card-popup-close { width: 32px; height: 32px; font-size: 18px; }
    .card-grid { grid-template-columns: 1fr; gap: 10px; }
    .card-popup-content { padding: 14px; padding-bottom: 40px; }
    .card-card { padding: 14px; }
    .card-card h5 { font-size: 0.92em; }
    .card-price { font-size: 0.82em; }
    .card-category h4 { font-size: 0.9em; margin-bottom: 12px; }

    h2 { font-size: 1.2em; }
    h3 { font-size: 1.1em; }
}

.product-detail-info-section {
    margin-top: 24px;
    padding: 0 !important;
    border: none;
}
.product-detail-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 20px;
    background: #f9f9f9;
    border: 2px solid #1d1d1f;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.product-detail-toggle:active {
    background: #e8e8ed;
}
.product-detail-toggle h2 {
    margin: 0;
    font-size: 1em;
    font-weight: 700;
    color: #1d1d1f;
}
.toggle-arrow-icon {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}
.product-detail-toggle.open {
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid #e5e5e5;
}
.product-detail-toggle.open .toggle-arrow-icon {
    transform: rotate(180deg);
}
.product-detail-images {
    border: 2px solid #1d1d1f;
    border-top: none;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}
.product-detail-images img {
    width: 100%;
    display: block;
}

@media (min-width: 768px) {
    .product-info-section { flex-direction: row; }
    .image-gallery, .product-summary { flex: 1; }
    .option-buttons { display: flex; flex-wrap: wrap; }
    .option-buttons .option-btn { flex-grow: 1; min-width: fit-content; }
    #capacityButtons { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
    .address-input-group { flex-direction: row; align-items: center; }
}
