/* ─────────────────────────────────────────────
   가정의 달 프론트 페이지 (family_month.css)
───────────────────────────────────────────── */

.fm-front-page {
    min-height: 70vh;
    background: #fff;
}

/* 공통 inner wrapper */
.fm-inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── 타이틀 섹션 ─────────────────────────────── */
.fm-title-section {
    padding: 70px 0;
    background: #fff;
}

.fm-title-sub {
    font-size: 32px;
    color: var(--ssadang-black);
    margin: 0;
    font-weight: 700;
}

.fm-title-main {
    font-size: 32px;
    font-weight: 700;
    color: var(--ssadang-black);
    margin: 0;
    letter-spacing: -0.02em;
}

/* ── 카테고리 탭 ──────────────────────────────── */
.fm-tabs-wrap {
    background: #fff;
}

.fm-tabs-scroll {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.fm-tabs-scroll::-webkit-scrollbar {
    display: none;
}

.fm-tab {
    flex-shrink: 0;
    padding: 14px;
    font-size: 28px;
    font-weight: 600;
    color: var(--ssadang-gray-2);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.fm-tab.active {
    color: var(--ssadang-black);
    font-weight: 700;
}

/* ── 필터 바 ──────────────────────────────────── */
.fm-filter-bar {
    background: #fff;
    padding: 12px 0;    
}

.fm-filter-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* ── 통신사 커스텀 드롭다운 ─────────────────────────────── */
.fm-carrier-dropdown {
    position: relative;
}

.fm-carrier-selected {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    border: none;
    background: #fff;
    cursor: pointer;
    font-size: 0.83rem;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-width: 190px;
    box-shadow: 0 1px 5.2px 0 rgba(0, 0, 0, 0.25);
}

.fm-carrier-selected__label {
    flex: 1;
    font-size: 16px;
    text-align: left;
}

.fm-carrier-chevron {
    flex-shrink: 0;
    color: #aaa;
    transition: transform 0.2s;
}

.fm-carrier-dropdown.open .fm-carrier-chevron {
    transform: rotate(180deg);
}

.fm-carrier-options {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 190px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    z-index: 200;
}

.fm-carrier-dropdown.open .fm-carrier-options {
    display: block;
}

.fm-carrier-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: background 0.1s;
}

.fm-sort-tex {
    font-size: 16px;
}


/* ── 통신사 아이콘 배지 ──────────────────────────────── */
.fm-ci {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: auto;    
    flex-shrink: 0;
    line-height: 1;
}

img.fm-ci {
    object-fit: contain;
    background: transparent;
}

.fm-ci--mvno {    
    color: var(--ssadang-gray);
}

.fm-sort-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 16px;
    color: var(--ssadang-black);
    font-weight: 500;
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

.fm-sort-text {
    font-size: 16px;
}


/* ── 카드 그리드 ──────────────────────────────── */
.fm-grid-section {
    padding: 24px 0 80px;
}

.fm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
}

/* ── 카드 ─────────────────────────────────────── */
.fm-card {    
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.fm-card__img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--ssadang-bg-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.fm-card__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 36px;
}

.fm-card__img-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}

/* ── 쿠폰받기 뱃지 (비로그인 시 이미지 위 오버레이) ── */
.fm-card__coupon-badge {
    position: absolute;
    bottom: 40%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--ssadang-black);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    padding: 7px 14px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    pointer-events: none;
    z-index: 1;
}

.fm-card__body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* 용량 (256GB 등) */
.fm-card__storage {
    font-size: 17px;
    color: var(--ssadang-gray-2);
    font-weight: 400;
}

/* 모델명 */
.fm-card__model {
    font-size: 18px;
    font-weight: 500;
    color: var(--ssadang-black);
    line-height: 1.3;
}

/* 가격 행 */
.fm-card__price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 4px;
}

.fm-card__discount {
    font-size: 20px;
    font-weight: 700;
    color: var(--ssadang-variation-red-color);
}

.fm-card__price {
    font-size: 20px;
    font-weight: 600;
    color: var(--ssadang-black);
}

/* 쿠폰 적용 행 (주 가격) */
.fm-card__coupon-row {
    display: flex;
    align-items: baseline;
    gap: 8px;    
}

.fm-card__coupon-label {
    font-size: 18px;
    font-weight: 500;
    color: var(--ssadang-black);
}

.fm-card__coupon-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--ssadang-variation-red-color);
}

/* 쿠폰 활성 시 원래 가격 행 → 보조 행 (작게 + 취소선) */
.fm-card__price-row--secondary {
    margin-top: -4px;
}

.fm-card__price-row--secondary .fm-card__discount {
    font-size: 18px;
    font-weight: 500;
    color: var(--ssadang-gray);
}

.fm-card__price-row--secondary .fm-card__price {
    font-size: 16px;
}

.fm-card__price.is-struck {
    color: var(--ssadang-gray);
    text-decoration: line-through;
    font-weight: 400;
}

/* ── 빈 상태 ──────────────────────────────────── */
.fm-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #bbb;
    font-size: 0.95rem;
}

/* ── 준비 중 ──────────────────────────────────── */
.fm-coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 24px;
    text-align: center;
    color: #999;
    gap: 16px;
}

.fm-coming-soon__icon { font-size: 3rem; }
.fm-coming-soon__text { font-size: 1.1rem; }

/* ── 통신사 선택 모달 ─────────────────────────────────────── */
.fm-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.46);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.fm-modal {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 468px;
    padding: 30px 14px;
    position: relative;
    max-height: 92vh;
    overflow-y: auto;
}

.fm-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    padding: 4px;
    line-height: 1;
    transition: color 0.15s;
}

.fm-modal__header {
    display: flex;
    align-items: center;
    gap: 12px;    
    margin-bottom: 31px;
    padding-right: 28px;
}

.fm-modal__thumb {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 10px;
    background: #f5f5f5;
    flex-shrink: 0;
}

.fm-modal__hinfo {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.fm-modal__hstorage {
    font-size: 15px;
    color: var(--ssadang-gray-2);
    font-weight: 400;
}

.fm-modal__hmodel {
    font-size: 18px;
    font-weight: 500;
    color: var(--ssadang-black);
    line-height: 1.3;
}

.fm-modal__sub {
    font-size: 20px;
    font-weight: 500;
    color: var(--ssadang-black);
    margin-bottom: 18px;
}

.fm-modal__carrier-list {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fm-modal__row {
    display: flex;
    align-items: center;
    min-height: 86px;
    padding: 14px 24px;
    border: 1.5px solid #ebebeb;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}


.fm-modal__row--disabled {
    opacity: 0.45;
    cursor: default;
    background: #fafafa;
}

.fm-modal__ci {
    width: 48px;
    height: 26px;
    object-fit: contain;
    flex-shrink: 0;
}

.fm-modal__row-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fm-modal__badge {
    background: var(--ssadang-variation-red-color);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 6px;
}

.fm-modal__badge--new {
    background: #1976d2;
}

.fm-modal__price {
    font-size: 20px;
    font-weight: 600;
    color: var(--ssadang-black);
}

.fm-modal__nostock {
    font-size: 0.82rem;
    color: #bbb;
    font-weight: 500;
}

/* 모달 가격 래퍼 (쿠폰 표시용) */
.fm-modal__price-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.fm-modal__price.is-struck {
    color: var(--ssadang-gray);
    text-decoration: line-through;
    font-weight: 400;
    font-size: 16px;
}

.fm-modal__coupon-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.fm-modal__coupon-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--ssadang-black);
}

.fm-modal__notes {
    list-style: none;
    background: var(--ssadang-bg-gray);
    border-radius: 8px;
    padding: 20px;
    margin: 0;
}

.fm-modal__notes li {
    position: relative;
    font-size: 14px;
    color: var(--ssadang-gray);
    line-height: 1.7;
    padding-left: 12px;
}

.fm-modal__notes li::before {
    content: '•';
    position: absolute;
    left: 0;
    top: 0;
    color: #bbb;
}


/* ── 반응형: 모바일 (2열) ─────────────────────── */
@media (max-width: 640px) {
    .fm-title-section {
        padding: 48px 0 35px;
    }

    .fm-title-sub,
    .fm-title-main {
        font-size: 24px;    
    }

    .fm-filter-inner {        
        gap: 8px;
    }

    .fm-carrier-selected {
        min-width: 160px;
    }

    .fm-carrier-options {
        min-width: 160px;
    }

    .fm-carrier-selected__label,
    .fm-sort-text {
        font-size: 15px;
    }

    .fm-ci {
        width: 18px;
        height: auto;
    }

    .fm-filter-bar {
        padding: 24px 0 0;
    }

    .fm-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 13px;
    }

    .fm-tab {
        padding: 4px 14px;
        font-size: 20px;
    }

    .fm-carrier-btn {
        font-size: 16px;
        padding: 5px 11px;
    }

    .fm-card__body {
        padding: 10px 4px;
    }
    .fm-card__img {
        padding: 22px;
    }

    .fm-card__storage {
        font-size: 15px;
    }

    .fm-card__model {
        font-size: 16px;
    }

    .fm-card__price {
        font-size: 16px;
    }

    .fm-card__discount {
        font-size: 16px;
    }

    .fm-card__coupon-label {
        font-size: 14px;
    }

    .fm-card__coupon-row {
        gap: 5px;
    }
    .fm-card__coupon-price {
        font-size: 16px;
    }
    .fm-card__price-row--secondary .fm-card__discount,
    .fm-card__price-row--secondary .fm-card__price {
        font-size: 14px;
    }

    .fm-modal__hstorage{
        font-size: 14px;
    }

    .fm-modal__hmodel {
        font-size: 16px;
    }

    .fm-modal__sub,
    .fm-modal__price {
        font-size: 18px;
    }

    .fm-modal__notes {
        padding: 8px;
    }

    .fm-modal__notes li {
        font-size: 12px;
    }

   
}

/* ── 쿠폰 이벤트 로그인 유도 모달 ─────────────────────────── 
.fm-coupon-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.fm-coupon-modal-overlay.is-open { display: flex; }
.fm-coupon-modal {
    position: relative;
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 360px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 0 24px;
}
.fm-coupon-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #888;
    z-index: 1;
}
.fm-coupon-modal__title {
    width: 100%;
    padding: 18px 20px 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--ssadang-black);
    text-align: left;
}
.fm-coupon-modal__img-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f0f0f0;
}
.fm-coupon-modal__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.fm-coupon-modal__login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 40px);
    margin: 20px 0 0;
    padding: 14px 20px;
    background: #FEE500;
    color: #3C201F;
    font-size: 15px;
    font-weight: 700;
    border-radius: 12px;
    text-decoration: none;
}
.fm-coupon-modal__login-btn:hover { background: #f5d900; color: #3C201F; }
.fm-coupon-modal__skip {
    margin-top: 14px;
    background: none;
    border: none;
    font-size: 14px;
    color: #999;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px;
}

*/