/* ========================================
   휴대폰 상세페이지 - 프리미엄 금융 UI 스타일
   Version: 2.0.0
   Updated: 2025-12-15
   ======================================== */

/* ========================================
   1. CSS 변수 - 프리미엄 컬러 시스템
   ======================================== */
:root {
    /* 메인 컬러 */
    --premium-navy: #0F1E3A;
    --premium-navy-light: #1A2D4F;
    --premium-navy-dark: #0A1528;

    /* 포인트 컬러 (액션) */
    --premium-accent: #FF4D4F;
    --premium-accent-dark: #E04142;
    --premium-accent-light: #FF6B6D;

    /* 성공/혜택 컬러 */
    --premium-success: #22C55E;
    --premium-success-light: #4ADE80;
    --premium-success-bg: #F0FDF4;

    /* 정보 컬러 */
    --premium-info: #3B82F6;
    --premium-info-light: #60A5FA;

    /* 텍스트 */
    --premium-text-primary: #111827;
    --premium-text-secondary: #6B7280;
    --premium-text-tertiary: #9CA3AF;

    /* 배경 */
    --premium-bg-main: #F8FAFC;
    --premium-bg-card: #FFFFFF;
    --premium-bg-subtle: #F1F5F9;

    /* 보더 */
    --premium-border: #E2E8F0;
    --premium-border-dark: #CBD5E1;

    /* 그라데이션 */
    --premium-gradient-primary: linear-gradient(135deg, #0F1E3A 0%, #1A2D4F 100%);
    --premium-gradient-accent: linear-gradient(135deg, #FF4D4F 0%, #E04142 100%);
    --premium-gradient-success: linear-gradient(135deg, #22C55E 0%, #16A34A 100%);

    /* 하단 네비게이션 높이 (JS에서 실제 값으로 덮어씀) */
    --bottom-nav-h: 60px;
}

/* ========================================
   2. 상세 페이지 레이아웃
   ======================================== */
.detail-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    background: var(--premium-bg-main);
}

.detail-top {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
}

.detail-left {
    flex: 1;
    display: flex;
    gap: 30px;
}

.detail-right {
    width: 380px;
    flex-shrink: 0;
}

/* ========================================
   3. 상품 이미지 영역
   ======================================== */
.product-image-area {
    width: 320px;
    flex-shrink: 0;
}

.product-main-image {
    width: 100%;
    aspect-ratio: 1;
    background: var(--premium-bg-card);
    border: 1px solid var(--premium-border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.product-main-image img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
}

.product-main-image .phone-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.product-main-image .phone-placeholder i {
    font-size: 80px;
    color: #D1D5DB;
}

.product-main-image .phone-placeholder span {
    font-size: 14px;
    color: var(--premium-text-tertiary);
    margin-top: 10px;
}

/* ========================================
   4. 옵션 영역
   ======================================== */
.product-options-area {
    flex: 1;
}

.product-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.product-title-row h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--premium-text-primary);
    margin: 0;
}

.product-title-row .badge {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.product-title-row .badge.blue {
    background: #EFF6FF;
    color: #2563EB;
    border: 1px solid #BFDBFE;
}

.product-title-row .badge.orange {
    background: #FFF7ED;
    color: #EA580C;
    border: 1px solid #FED7AA;
}

.product-title-row .badge.green {
    background: var(--premium-success-bg);
    color: var(--premium-success);
    border: 1px solid #BBF7D0;
}

.product-title-row .badge.purple {
    background: #FAF5FF;
    color: #9333EA;
    border: 1px solid #E9D5FF;
}

.product-title-row .badge.red {
    background: #FEF2F2;
    color: var(--premium-accent);
    border: 1px solid #FECACA;
}

/* 옵션 행 */
.option-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--premium-border);
}

.option-row:last-child {
    border-bottom: none;
}

.option-label {
    width: 130px;
    font-size: 15px;
    font-weight: 600;
    color: var(--premium-text-secondary);
    padding-top: 14px;
    flex-shrink: 0;
}

.option-content {
    flex: 1;
}

/* 옵션 버튼 - 프리미엄 스타일 */
.option-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* opt-grid: PC 기본 스타일 (가로 배치) */
.opt-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.opt-grid.auto-cols {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* 색상 버튼: 모든 화면에서 flexbox 고정 (grid 사용 안함) */
#colorButtons {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    grid-template-columns: unset !important;
}

.option-btn {
    min-width: 90px;
    padding: 14px 24px;
    border: 2px solid var(--premium-border);
    border-radius: 10px;
    background: var(--premium-bg-card);
    font-size: 15px;
    font-weight: 500;
    color: var(--premium-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
}

.option-btn:hover {
    border-color: var(--premium-border-dark);
    color: var(--premium-text-primary);
}

.option-btn.active {
    border-color: var(--premium-navy);
    background: var(--premium-bg-subtle);
    color: var(--premium-navy);
    font-weight: 600;
}

.option-btn.active::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: var(--premium-navy);
    color: white;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 색상 버튼 */
.color-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--premium-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.color-btn:hover {
    transform: scale(1.05);
}

.color-btn.active {
    border-color: var(--premium-navy);
    box-shadow: 0 0 0 3px var(--premium-bg-card), 0 0 0 5px var(--premium-navy);
}

.color-btn.active::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.color-name {
    margin-left: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--premium-text-primary);
}

/* 통신사 버튼 - 프리미엄 스타일 */
.carrier-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.carrier-btn {
    width: 80px;
    height: 56px;
    border: 2px solid var(--premium-border);
    border-radius: 10px;
    background: var(--premium-bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 8px;
    position: relative;
}

.carrier-btn img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(30%);
    opacity: 0.8;
    transition: all 0.2s ease;
}

.carrier-btn span {
    font-size: 13px;
    font-weight: 600;
    color: var(--premium-text-secondary);
}

.carrier-btn:hover {
    border-color: var(--premium-border-dark);
}

.carrier-btn:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

.carrier-btn.active {
    border-color: var(--premium-navy);
    background: var(--premium-bg-subtle);
}

.carrier-btn.active img {
    filter: grayscale(0%);
    opacity: 1;
}

.carrier-btn.active::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: var(--premium-navy);
    color: white;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 기기변경/통신사이동 칩 */
.telecom-change-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--premium-text-secondary);
}

.telecom-change-hint .hint-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.telecom-change-hint .hint-badge::before {
    content: '\f058';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 12px;
}

.telecom-change-hint .hint-badge.change {
    background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
    color: #1D4ED8;
}

.telecom-change-hint .hint-badge.move {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    color: #DC2626;
}

.telecom-change-hint .hint-text {
    color: var(--premium-text-primary);
    font-weight: 500;
}

/* 추천 조합 배지 */
.recommended-combo-badge {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    border: 1px solid #A7F3D0;
    border-radius: 12px;
    animation: recommendedFadeIn 0.3s ease;
}

/* 추천 조합이 아닐 때 (안내 상태) */
.recommended-combo-badge.is-guide {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border-color: #FCD34D;
}

.recommended-combo-badge.is-guide .recommended-icon {
    color: #D97706;
}

.recommended-combo-badge.is-guide .recommended-text,
.recommended-combo-badge.is-guide .recommended-subtext {
    color: #92400E;
}

.recommended-combo-badge.is-guide .recommended-discount {
    color: #B45309;
}

@keyframes recommendedFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recommended-combo-badge .recommended-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.recommended-combo-badge .recommended-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recommended-combo-badge .recommended-text {
    font-size: 13px;
    font-weight: 600;
    color: #047857;
    line-height: 1.4;
}

.recommended-combo-badge .recommended-subtext {
    font-size: 12px;
    font-weight: 500;
    color: #059669;
    line-height: 1.4;
}

.recommended-combo-badge .recommended-subtext:empty {
    display: none;
}

.recommended-combo-badge .recommended-discount {
    font-size: 14px;
    font-weight: 700;
    color: #059669;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: center;
}

/* 요금제 선택 박스 */
.plan-select-wrapper {
    width: 100%;
}

.plan-select-box {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--premium-border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--premium-text-primary);
    background: var(--premium-bg-card);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.plan-select-box:hover {
    border-color: var(--premium-navy);
}

.plan-select-text {
    flex: 1;
    font-weight: 500;
}

.plan-select-arrow {
    color: var(--premium-text-tertiary);
    font-size: 12px;
    transition: transform 0.2s ease;
}

.plan-select-box:hover .plan-select-arrow {
    transform: translateY(2px);
}

/* 할인방법 버튼 - 프리미엄 스타일 */
.discount-buttons {
    display: flex;
    gap: 12px;
}

.discount-btn {
    flex: 1;
    padding: 18px 20px;
    border: 2px solid var(--premium-border);
    border-radius: 12px;
    background: var(--premium-bg-card);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    position: relative;
}

.discount-btn .badge-recommend {
    position: absolute;
    top: -10px;
    right: 12px;
    background: var(--premium-gradient-accent);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(255, 77, 79, 0.3);
}

.discount-btn:hover {
    border-color: var(--premium-border-dark);
}

.discount-btn.active {
    border-color: var(--premium-navy);
    background: var(--premium-bg-subtle);
}

.discount-btn .title {
    font-size: 15px;
    font-weight: 600;
    color: var(--premium-text-primary);
    margin-bottom: 6px;
}

.discount-btn .amount {
    font-size: 14px;
    color: var(--premium-text-secondary);
}

.discount-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--premium-text-secondary);
}

.discount-notice .badge {
    background: var(--premium-text-secondary);
    color: white;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* 구매방법 버튼 */
.purchase-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.purchase-btn {
    padding: 14px 24px;
    border: 2px solid var(--premium-border);
    border-radius: 10px;
    background: var(--premium-bg-card);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--premium-text-secondary);
    transition: all 0.2s ease;
    position: relative;
}

.purchase-btn .badge-popular {
    position: absolute;
    top: -8px;
    right: -5px;
    background: var(--premium-gradient-accent);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
}

.purchase-btn:hover {
    border-color: var(--premium-border-dark);
    color: var(--premium-text-primary);
}

.purchase-btn.active {
    border-color: var(--premium-navy);
    background: var(--premium-bg-subtle);
    color: var(--premium-navy);
    font-weight: 600;
}

/* 제휴카드 드롭다운 */
.card-select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--premium-border);
    border-radius: 10px;
    font-size: 15px;
    color: var(--premium-text-primary);
    background: var(--premium-bg-card);
    cursor: pointer;
    transition: all 0.2s ease;
}

.card-select:hover,
.card-select:focus {
    border-color: var(--premium-navy);
    outline: none;
}

/* ========================================
   5. 우측 가격 사이드바 - 프리미엄 리디자인
   ======================================== */
.price-sidebar {
    position: sticky;
    top: 100px;
}

.price-card {
    background: var(--premium-bg-card);
    border: 1px solid var(--premium-border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* 월 납부금 헤더 - 최상단 강조 */
.price-monthly-header {
    background: var(--premium-gradient-primary);
    padding: 28px 24px;
    text-align: center;
    position: relative;
}

.price-monthly-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 12px solid var(--premium-navy-dark);
}

.price-monthly-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 8px;
    font-weight: 500;
}

.price-monthly-value {
    font-size: 42px;
    font-weight: 800;
    color: white;
    line-height: 1;
    margin-bottom: 6px;
    letter-spacing: -1px;
}

.price-monthly-value small {
    font-size: 20px;
    font-weight: 600;
}

.price-monthly-period {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

/* 현재 선택 기준 신뢰 문구 */
.price-trust-notice {
    background: var(--premium-bg-subtle);
    padding: 14px 20px;
    text-align: center;
    border-bottom: 1px solid var(--premium-border);
}

.price-trust-notice p {
    font-size: 12px;
    color: var(--premium-text-secondary);
    line-height: 1.6;
    margin: 0;
}

.price-trust-notice strong {
    color: var(--premium-text-primary);
    font-weight: 600;
}

/* 이 가격이 가능한 이유 섹션 */
.price-reason-section {
    padding: 24px;
    background: var(--premium-bg-card);
}

.price-reason-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--premium-text-primary);
    margin-bottom: 16px;
}

.price-reason-title i {
    color: var(--premium-success);
    font-size: 18px;
}

/* 할인 상세 박스 */
.discount-detail-box {
    background: var(--premium-bg-subtle);
    border-radius: 12px;
    padding: 16px;
}

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

.discount-detail-row:not(:last-child) {
    border-bottom: 1px dashed var(--premium-border);
}

.discount-detail-row .label {
    color: var(--premium-text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.discount-detail-row .label i {
    font-size: 12px;
    color: var(--premium-success);
}

.discount-detail-row .value {
    font-weight: 600;
    color: var(--premium-success);
}

.discount-detail-row.total {
    margin-top: 12px;
    padding-top: 14px;
    border-top: 2px solid var(--premium-success);
    border-bottom: none;
}

.discount-detail-row.total .label {
    font-weight: 700;
    color: var(--premium-text-primary);
}

.discount-detail-row.total .value {
    font-size: 18px;
    font-weight: 800;
    color: var(--premium-accent);
}

/* 요금 상세 접기/펼치기 */
.price-detail-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    background: var(--premium-bg-subtle);
    border-top: 1px solid var(--premium-border);
    cursor: pointer;
    font-size: 13px;
    color: var(--premium-text-secondary);
    transition: all 0.2s ease;
}

.price-detail-toggle:hover {
    background: var(--premium-border);
    color: var(--premium-text-primary);
}

.price-detail-toggle i {
    transition: transform 0.2s ease;
}

.price-detail-toggle.expanded i {
    transform: rotate(180deg);
}

/* 가격 상세 (접힌 상태) */
.price-detail-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.price-detail-content.expanded {
    max-height: 500px;
}

.price-detail-inner {
    padding: 20px 24px;
    background: var(--premium-bg-card);
}

/* A/B 섹션 */
.price-ab-section {
    margin-bottom: 16px;
}

.price-ab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--premium-navy);
    border-radius: 8px;
    margin-bottom: 12px;
}

.price-ab-header .ab-badge {
    background: #1ce2ed;
    color: var(--premium-navy);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
}

.price-ab-header .ab-title {
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin-left: 10px;
}

.price-ab-header .ab-value {
    color: white;
    font-size: 16px;
    font-weight: 700;
}

.price-detail-rows {
    padding: 0 4px;
}

.price-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px dashed var(--premium-border);
}

.price-detail-row:last-child {
    border-bottom: none;
}

.price-detail-row .label {
    color: var(--premium-text-secondary);
}

.price-detail-row .value {
    font-weight: 600;
    color: var(--premium-text-primary);
}

.price-detail-row .value.blue {
    color: var(--premium-info);
}

.price-detail-row .value.red {
    color: var(--premium-accent);
}

.price-detail-row.result {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 2px solid var(--premium-info);
}

.price-detail-row.result .label {
    font-weight: 600;
    color: var(--premium-text-primary);
}

/* 버튼 영역 - 프리미엄 스타일 */
.action-buttons {
    padding: 24px;
    background: var(--premium-bg-card);
}

/* 신청 전 안내 문구 */
.apply-guarantee {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--premium-success);
    font-weight: 600;
}

.apply-guarantee i {
    font-size: 16px;
}

.btn-apply {
    width: 100%;
    padding: 18px 24px;
    background: var(--premium-gradient-accent);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(255, 77, 79, 0.35);
    position: relative;
    overflow: hidden;
}

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

.btn-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 77, 79, 0.45);
}

.btn-apply:hover::before {
    left: 100%;
}

.btn-row {
    display: flex;
    gap: 10px;
}

.btn-wishlist {
    width: 52px;
    height: 52px;
    border: 2px solid var(--premium-border);
    border-radius: 12px;
    background: var(--premium-bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--premium-text-tertiary);
    font-size: 22px;
    transition: all 0.2s ease;
}

.btn-wishlist:hover {
    color: var(--premium-accent);
    border-color: var(--premium-accent);
}

.btn-kakao {
    flex: 1;
    padding: 14px;
    background: #FEE500;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #3C1E1E;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-kakao:hover {
    background: #F5DC00;
    transform: translateY(-1px);
}

.btn-kakao img {
    width: 22px;
    height: 22px;
}

/* ========================================
   6. 모바일 하단 고정 Sticky Bar
   ======================================== */
.mobile-sticky-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--premium-bg-card);
    border-top: 1px solid var(--premium-border);
    padding: 12px 16px;
    z-index: 9999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.mobile-sticky-bar .sticky-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 100%;
}

.mobile-sticky-bar .sticky-price {
    flex: 1;
}

.mobile-sticky-bar .sticky-price-label {
    font-size: 12px;
    color: var(--premium-text-secondary);
    margin-bottom: 2px;
}

.mobile-sticky-bar .sticky-price-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--premium-navy);
}

.mobile-sticky-bar .sticky-price-value small {
    font-size: 14px;
    font-weight: 600;
}

.mobile-sticky-bar .sticky-price-period {
    font-size: 11px;
    color: var(--premium-text-tertiary);
}

.mobile-sticky-bar .sticky-btn {
    padding: 16px 32px;
    background: var(--premium-gradient-accent);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 77, 79, 0.3);
    white-space: nowrap;
}

.mobile-sticky-bar .sticky-btn:active {
    transform: scale(0.98);
}

/* ========================================
   7. 반응형 스타일
   ======================================== */
@media (max-width: 1024px) {
    .detail-top {
        flex-direction: column;
    }

    .detail-left {
        flex-direction: column;
    }

    .product-image-area {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .detail-right {
        width: 100%;
    }

    .price-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .detail-page {
        padding: 0;
        padding-bottom: 20px;
    }

    /* 모바일 레이아웃: 상품정보 → 옵션 → 가격카드(맨 아래) */
    .detail-top {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .detail-right {
        order: 1; /* 가격 영역을 맨 아래로 */
        margin-bottom: 0;
        padding: 0 12px;
    }

    .detail-left {
        order: 0;
    }

    /* 모바일 Sticky Bar 숨김 */
    .mobile-sticky-bar {
        display: none !important;
    }

    /* 버튼 영역 표시 */
    .action-buttons {
        display: flex !important;
        padding: 16px 12px;
    }

    /* 상품 이미지 영역 */
    .product-image-area {
        padding: 0;
        border-radius: 0;
        border: none;
        border-bottom: 6px solid #f1f3f5;
    }

    /* 상품 정보 영역 */
    .product-info-area {
        padding: 16px 12px;
        border-bottom: 6px solid #f1f3f5;
    }

    .product-title-row h1 {
        font-size: 20px;
    }

    /* 옵션 영역 - 양옆 여백 최소화 */
    .options-area {
        padding: 0;
    }

    .option-section {
        padding: 16px 12px;
        border-bottom: 1px solid #e5e7eb;
    }

    .option-section:last-child {
        border-bottom: 6px solid #f1f3f5;
    }

    .option-row {
        flex-direction: column;
        gap: 10px;
    }

    .option-label {
        width: 100%;
        padding: 0;
        font-size: 16px;
        font-weight: 700;
    }

    /* 가격 카드 - 양옆 여백 최소화 */
    .price-card {
        border-radius: 12px;
        margin: 16px 0;
    }

    .price-monthly-header {
        padding: 16px;
    }

    .price-monthly-value {
        font-size: 32px;
    }

    /* 할인 상세 기본 펼친 상태 */
    .price-detail-content {
        max-height: none;
    }
}

@media (max-width: 480px) {
    .product-title-row h1 {
        font-size: 18px;
    }

    .price-monthly-value {
        font-size: 28px;
    }

    .price-card {
        margin: 12px 0;
    }

    /* 가격 카드 영역 좌우 여백 최소화 */
    .detail-right {
        padding: 0 4px;
    }
}

/* ========================================
   8. 요금제 모달 - 프리미엄 스타일
   ======================================== */
.plan-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 30, 58, 0.6);
    z-index: 120000; /* above bottom nav */
    align-items: flex-end;
    justify-content: center;
    padding: 16px 12px calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 12px);
}

.plan-modal-overlay.active {
    display: flex;
}

.plan-modal {
    position: relative;
    background: var(--premium-bg-card);
    width: min(92vw, 480px);
    min-height: min(52dvh, 520px);
    max-height: min(78dvh, 720px);
    border-radius: 18px 18px 12px 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    z-index: 120001; /* above overlay */
    transform: none;
    left: auto;
    top: auto;
    display: flex;
    flex-direction: column;
}

.plan-modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--premium-border);
    position: relative;
    background: var(--premium-bg-card);
}

.plan-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--premium-text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.plan-modal-close {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--premium-bg-subtle);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    color: var(--premium-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.plan-modal-close:hover {
    background: var(--premium-border);
    color: var(--premium-text-primary);
}

.plan-modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    max-height: calc(min(78dvh, 720px) - 72px);
    margin: 12px;
    border: 1px solid var(--premium-border);
    border-radius: 12px;
    overflow-x: hidden;
    padding-bottom: env(safe-area-inset-bottom);
}

/* 요금제 카테고리 헤더 */
.plan-category-header {
    background: var(--premium-gradient-primary);
    color: white;
    padding: 14px 24px;
}

.plan-category-title {
    font-size: 16px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.plan-category-title .badge-5g {
    background: white;
    color: var(--premium-accent);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

/* 요금제 테이블 행 */
.plan-table-row {
    display: table;
    width: 100%;
    table-layout: fixed;
    border-bottom: 1px solid var(--premium-border);
    cursor: pointer;
    transition: all 0.15s ease;
}

.plan-table-row:hover {
    background: var(--premium-bg-subtle);
}

.plan-table-row.selected {
    background: #FEF3C7;
    border-left: 4px solid var(--premium-accent);
}

.plan-col {
    display: table-cell;
    vertical-align: middle;
    padding: 16px 12px;
    font-size: 14px;
}

.plan-col-name {
    width: 18%;
    font-weight: 600;
    color: var(--premium-text-primary);
    padding-left: 20px;
}

.plan-col-price {
    width: 16%;
    color: var(--premium-info);
    font-weight: 700;
    font-size: 15px;
}

.plan-col-data {
    width: 22%;
}

.plan-col-data .main {
    color: var(--premium-accent);
    font-weight: 600;
}

.plan-col-data .sub {
    color: var(--premium-text-secondary);
    font-size: 12px;
    display: block;
    margin-top: 2px;
}

/* 요금제 모달 - 모바일 최적화 */
@media (max-width: 768px) {
    .plan-modal {
        width: min(92vw, 480px);
        min-height: min(52dvh, 520px);
        max-height: min(78dvh, 720px);
        border-radius: 18px 18px 12px 12px;
    }

    .plan-modal-header {
        padding: 12px 16px;
    }

    .plan-modal-title {
        font-size: 15px;
    }

    .plan-modal-body {
        margin: 10px;
        max-height: calc(min(78dvh, 720px) - 68px);
        -webkit-overflow-scrolling: touch;
    }

    .plan-category-header {
        padding: 10px 12px;
    }

    .plan-category-desc {
        display: none !important;
    }

    .plan-category-title {
        font-size: 11px;
        line-height: 1.4;
        white-space: normal;
        word-break: keep-all;
    }

    .plan-category-title .badge-5g {
        padding: 2px 6px;
        font-size: 9px;
        flex-shrink: 0;
    }

    /* 모바일: 요금제명 첫줄, 나머지 둘째줄 */
    .plan-table-row {
        display: flex !important;
        flex-wrap: wrap;
        padding: 10px 12px;
        border-bottom: 1px solid #e5e7eb;
        font-size: 10px !important;
    }

    .plan-table-row * {
        font-size: 10px !important;
    }

    .plan-table-row.selected {
        background: #FEF3C7;
        border-left: 3px solid var(--premium-accent);
    }

    /* 요금제 이름 - 첫줄 단독 */
    .plan-col-name {
        display: block !important;
        width: 100% !important;
        font-size: 12px !important;
        font-weight: 700;
        padding: 0 0 6px 0 !important;
        border-bottom: 1px solid #f3f4f6;
        margin-bottom: 6px;
    }

    /* 나머지 컬럼 - 둘째줄 가로 배치 */
    .plan-col {
        display: inline-block !important;
        padding: 0 !important;
        vertical-align: middle;
    }

    .plan-col-price {
        width: auto !important;
        font-weight: 700;
        color: #3b82f6;
        margin-right: 10px;
    }

    .plan-col-data {
        width: auto !important;
        margin-right: 8px;
    }

    .plan-col-data .main {
        font-weight: 600;
        color: #f59e0b;
    }

    .plan-col-data .sub {
        display: inline !important;
        color: #9ca3af;
        white-space: nowrap;
    }
}

/* ========================================
   9. 하단 탭 영역
   ======================================== */
.detail-tabs-section {
    margin-top: 40px;
    border-top: 1px solid var(--premium-border);
}

.detail-tabs {
    display: flex;
    border-bottom: 1px solid var(--premium-border);
    background: var(--premium-bg-card);
}

.detail-tab {
    flex: 1;
    padding: 18px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--premium-text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.detail-tab:hover {
    color: var(--premium-text-primary);
}

.detail-tab.active {
    color: var(--premium-navy);
    background: var(--premium-bg-subtle);
}

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

.detail-tab .count {
    display: inline-block;
    min-width: 26px;
    padding: 3px 8px;
    background: var(--premium-border);
    border-radius: 12px;
    font-size: 12px;
    margin-left: 6px;
}

.detail-tab.active .count {
    background: var(--premium-navy);
    color: white;
}

/* ========================================
   10. 신청 모달
   ======================================== */
.apply-form .form-group {
    margin-bottom: 18px;
}

.apply-form .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--premium-text-primary);
    margin-bottom: 8px;
}

.apply-form .form-group label .required {
    color: var(--premium-accent);
}

.apply-form input,
.apply-form select,
.apply-form textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--premium-border);
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.apply-form input:focus,
.apply-form select:focus,
.apply-form textarea:focus {
    outline: none;
    border-color: var(--premium-navy);
}

.apply-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.selected-info {
    background: var(--premium-bg-subtle);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 20px;
}

.selected-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--premium-info);
    margin-bottom: 12px;
}

.selected-info-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.selected-info-item {
    padding: 8px 14px;
    background: var(--premium-bg-card);
    border: 1px solid var(--premium-border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--premium-text-primary);
}

.submit-btn {
    width: 100%;
    padding: 18px;
    background: var(--premium-gradient-accent);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(255, 77, 79, 0.3);
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 77, 79, 0.4);
}

@media (max-width: 768px) {
    .apply-form .form-row {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   11. 모바일 옵션 버튼 - CSS Grid 시스템
   당근폰 스타일: 화면 너비 꽉 차는 레이아웃
   .detail-page 스코프로 특이성 확보
   ======================================== */
@media (max-width: 768px) {
    /* 옵션 행: 세로 배치 */
    .detail-page .option-row {
        flex-direction: column;
        gap: 10px;
    }

    .detail-page .option-label {
        width: 100%;
        padding: 0;
        font-size: 15px;
        font-weight: 700;
    }

    .detail-page .option-content {
        width: 100%;
    }

    /* opt-grid: data-cols 기반 자동 컬럼 시스템 */
    .detail-page .opt-grid {
        display: grid;
        width: 100%;
        gap: 8px;
        --cols: 4; /* 기본값 */
        grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    }

    /* data-cols 매핑: 옵션 개수에 따라 컬럼 자동 결정 */
    .detail-page .opt-grid[data-cols="1"] { --cols: 1; }
    .detail-page .opt-grid[data-cols="2"] { --cols: 2; }
    .detail-page .opt-grid[data-cols="3"] { --cols: 3; }
    .detail-page .opt-grid[data-cols="4"] { --cols: 4; }
    .detail-page .opt-grid[data-cols="5"] { --cols: 5; }
    .detail-page .opt-grid[data-cols="6"] { --cols: 6; }
    .detail-page .opt-grid[data-cols="7"] { --cols: 4; } /* 7개 이상은 4열로 제한 */
    .detail-page .opt-grid[data-cols="8"] { --cols: 4; }

    /* 버튼 공통 스타일 */
    .detail-page .option-btn,
    .detail-page .carrier-btn,
    .detail-page .discount-btn,
    .detail-page .purchase-btn {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        padding: 12px 6px;
        font-size: 13px;
        font-weight: 600;
        text-align: center;
        white-space: nowrap;
        text-overflow: ellipsis;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        box-sizing: border-box;
    }

    /* 색상 버튼 - 모바일에서 크기 대폭 축소 */
    .detail-page .color-btn {
        width: 28px;
        height: 28px;
        min-height: 28px;
        border-radius: 6px;
        border-width: 1.5px;
    }

    .detail-page .color-btn.active {
        box-shadow: 0 0 0 2px var(--premium-bg-card), 0 0 0 3.5px var(--premium-navy);
    }

    .detail-page .color-btn.active::after {
        font-size: 10px;
    }

    /* 할인방법 버튼 (세로 레이아웃) */
    .detail-page .discount-btn {
        min-height: 60px;
        flex-direction: column;
        position: relative;
    }

    .detail-page .discount-btn .title {
        font-size: 12px;
        font-weight: 700;
    }

    .detail-page .discount-btn .amount {
        font-size: 11px;
        margin-top: 4px;
    }

    .detail-page .discount-btn .badge-recommend {
        position: absolute;
        top: -8px;
        right: 8px;
        font-size: 9px;
        padding: 2px 6px;
    }

    /* 구매방법 버튼 */
    .detail-page .purchase-btn {
        font-size: 12px;
        padding: 10px 4px;
    }

    .detail-page .purchase-btn .badge-popular {
        display: none;
    }

    /* 통신사 버튼 */
    .detail-page .carrier-btn {
        height: 48px;
    }

    .detail-page .carrier-btn img {
        max-width: 80%;
        max-height: 80%;
    }
}

/* 480px 이하: 작은 화면 대응 */
@media (max-width: 480px) {
    /* keep-4: 4열 유지 (통신사/구매방법) */
    .detail-page .opt-grid.keep-4 {
        --cols: 4 !important;
        gap: 6px;
    }

    /* 색상: 5개 이상이면 4열로 제한 */
    .detail-page .opt-grid[data-cols="5"]:not(.keep-4),
    .detail-page .opt-grid[data-cols="6"]:not(.keep-4) {
        --cols: 4;
    }
}

/* 380px 이하: 초소형 화면 대응 */
@media (max-width: 380px) {
    /* keep-4: 4열 강제 유지 (gap 축소) */
    .detail-page .opt-grid.keep-4 {
        --cols: 4 !important;
        gap: 4px;
    }

    .detail-page .purchase-btn {
        font-size: 11px;
        padding: 8px 2px;
    }

    .detail-page .carrier-btn {
        font-size: 11px;
        padding: 8px 2px;
    }

    /* 색상: 전역 #colorButtons 스타일이 적용됨 */

    .detail-page .option-btn,
    .detail-page .discount-btn {
        font-size: 12px;
        padding: 10px 4px;
    }
}
