/* 메인페이지 (PC / 모바일 공용) */
.hm-icon {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
    vertical-align: -0.25em;
}

.hm {
    --hm-green: #047857;
    --hm-green-soft: #ecfdf5;
}

.hm button {
    font-family: inherit;
    cursor: pointer;
}

.hm button:focus-visible,
.hm a:focus-visible {
    outline: 2px solid var(--hm-green);
    outline-offset: 2px;
}

.hm-section {
    margin-top: 2.5rem;
}

.hm-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.hm-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem;
    color: var(--text-primary);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
}

.hm-title .hm-icon {
    color: var(--hm-green);
}

.hm-live {
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    background: var(--hm-green-soft);
    color: var(--hm-green);
    font-size: 0.75rem;
    font-weight: 700;
}

.hm-more {
    flex-shrink: 0;
    margin-bottom: 1rem;
    padding: 0.4rem 0;
    border: none;
    background: none;
    color: var(--hm-green);
    font-size: 0.92rem;
    font-weight: 600;
}

.hm-sub {
    margin: -0.6rem 0 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 상단: 배너 + 상담 */
.hm .hm-top {
    align-items: stretch;
    padding: 1rem 0 0;
}

.hm .hm-top .home-main {
    min-width: 0;
}

.hm .hm-top .banner-viewport {
    margin-bottom: 0;
}

.hm .hm-top .banner-content {
    flex: 0 1 52%;
}

.hm .hm-top .banner-desc {
    max-width: 24em;
    word-break: keep-all;
    text-wrap: balance;
}

.hm-contact {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: #fff;
}

.hm-contact h2 {
    margin: 0 0 1rem;
    color: var(--hm-green);
    font-size: 1.1rem;
    font-weight: 700;
}

.hm-contact-logo {
    display: block;
    width: auto;
    max-width: 100%;
    height: 34px;
    margin: 0 auto 0.3rem;
}

.hm-contact-lead {
    margin: 0 0 0.8rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.hm-contact-tel {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.hm-contact-mail {
    margin-bottom: 1.75rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.hm-actions {
    display: grid;
    gap: 0.75rem;
}

.hm-contact-downloads {
    display: grid;
    gap: 0.6rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}

/* 버튼 */
.hm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0 1.25rem;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 0.97rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.hm-btn-kakao {
    background: #fee500;
    color: #191600;
}

.hm-btn-primary {
    background: var(--hm-green);
    color: #fff;
}

.hm-btn-line {
    border-color: #cbd5e1;
    background: #fff;
    color: var(--text-primary);
}

.hm-btn-light {
    background: #fff;
    color: #065f46;
}

.hm-btn-ghost {
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

/* 단가표 바로가기 */
.hm-cats {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.75rem;
}

.hm-cat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 104px;
    padding: 0.75rem 0.25rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fff;
    color: var(--text-primary);
    font-size: 0.97rem;
    font-weight: 500;
    transition: border-color 0.15s, background-color 0.15s;
}

.hm-cat .hm-icon {
    width: 30px;
    height: 30px;
    color: var(--hm-green);
}

.hm-cat-ask {
    border-color: var(--hm-green);
    background: var(--hm-green);
    color: #fff;
}

.hm-cat-ask .hm-icon {
    color: #fff;
}

/* 매입 절차 */
.hm-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    padding: 1.5rem 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fff;
    list-style: none;
}

.hm-step {
    display: flex;
    gap: 0.9rem;
    padding: 0 1.5rem;
}

.hm-step + .hm-step {
    border-left: 1px solid var(--border-color);
}

.hm-step-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--hm-green-soft);
    color: var(--hm-green);
    font-size: 1.1rem;
}

.hm-step strong {
    display: block;
    color: var(--text-primary);
    font-size: 1.02rem;
}

.hm-step em {
    margin-right: 0.4rem;
    color: var(--hm-green);
    font-style: normal;
}

.hm-step p {
    margin: 0.15rem 0 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
    word-break: keep-all;
}

/* 매입 현황 카드 */
.hm-cases {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.2rem;
}

.hm-cases-message {
    grid-column: 1 / -1;
    padding: 2rem 1rem;
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    background: #fff;
    color: var(--text-secondary);
    text-align: center;
}

.hm-case {
    display: flex;
    flex-direction: column;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fff;
    color: inherit;
    overflow: hidden;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.hm-case-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 2rem;
    overflow: hidden;
}

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

.hm-case-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    padding: 1rem 1.1rem;
}

.hm-case-title {
    color: var(--text-primary);
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.hm-case-info {
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.hm-case-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin-top: auto;
    padding-top: 0.4rem;
    color: #475569;
    font-size: 0.83rem;
}

.hm-case-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.hm-case-meta .hm-icon {
    color: var(--hm-green);
}

/* 대량 매입 + 다운로드 */
.hm-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.hm-bulk {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.75rem 2rem;
    border-radius: 16px;
    background: #065f46;
    color: #fff;
}

.hm-bulk-icon {
    font-size: 2.2rem;
    line-height: 1;
}

.hm-bulk-text {
    flex: 1;
    min-width: 0;
}

.hm-bulk h2 {
    margin: 0;
    color: #fff;
    font-size: 1.25rem;
    line-height: 1.4;
    word-break: keep-all;
}

.hm-bulk p {
    margin: 0.2rem 0 0;
    color: #d1fae5;
    font-size: 0.95rem;
}

.hm-bulk-actions {
    display: flex;
    gap: 0.6rem;
}

.hm-downloads {
    display: grid;
    gap: 0.6rem;
}

.hm-download {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 52px;
    padding: 0 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fff;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
}

.hm-download span {
    flex: 1;
}

.hm-download .hm-icon {
    color: var(--hm-green);
}

@media (hover: hover) {
    .hm-cat:hover,
    .hm-case:hover,
    .hm-download:hover,
    .hm-btn-line:hover {
        border-color: var(--hm-green);
    }

    .hm-cat:not(.hm-cat-ask):hover {
        background: var(--hm-green-soft);
    }

    .hm-case:hover {
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.07);
    }

    .hm-btn-primary:hover,
    .hm-cat-ask:hover {
        background: #065f46;
    }

    .hm-btn-light:hover {
        background: #d1fae5;
    }
}

@media (min-width: 901px) {
    .hm .hm-top .main-banner {
        padding-top: 2.5rem;
        padding-bottom: 3rem;
    }
}

@media (max-width: 1100px) {
    .hm-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 1.5rem;
    }

    .hm-step:nth-child(odd) {
        border-left: none;
    }

    .hm-bottom {
        grid-template-columns: minmax(0, 1fr);
    }

    .hm-downloads {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 900px) {
    .hm-cats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .hm .hm-top .banner-content {
        flex-basis: auto;
    }
}

@media (max-width: 640px) {
    .hm-section {
        margin-top: 1.5rem;
    }

    .hm-title {
        margin-bottom: 0.7rem;
        font-size: 1.12rem;
    }

    .hm-more {
        min-height: 40px;
        margin-bottom: 0.4rem;
    }

    .hm-sub {
        display: none;
    }

    .hm-contact {
        padding: 1.25rem;
        border-radius: 12px;
        text-align: center;
    }

    .hm-contact-tel {
        font-size: 1.5rem;
    }

    .hm-contact-mail {
        margin-bottom: 1rem;
    }

    .hm-actions {
        gap: 0.55rem;
    }

    .hm-cats {
        gap: 0.5rem;
    }

    .hm-cat {
        gap: 0.4rem;
        min-height: 80px;
        padding: 0.5rem 0.1rem;
        font-size: 0.84rem;
    }

    .hm-cat .hm-icon {
        width: 24px;
        height: 24px;
    }

    .hm-steps {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 1rem;
        padding: 1.1rem 0;
    }

    .hm-step {
        padding: 0 1.1rem;
    }

    .hm-step + .hm-step {
        border-left: none;
    }

    .hm-cases {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.6rem;
    }

    .hm-case {
        flex-direction: row;
        align-items: center;
    }

    .hm-case-thumb {
        flex-shrink: 0;
        width: 96px;
        aspect-ratio: 1;
    }

    .hm-case-body {
        gap: 0.15rem;
        padding: 0.6rem 0.8rem;
    }

    .hm-case-title {
        font-size: 0.95rem;
    }

    .hm-case-title,
    .hm-case-info {
        -webkit-line-clamp: 1;
    }

    .hm-case-meta {
        padding-top: 0.15rem;
        font-size: 0.78rem;
    }

    .hm-bulk {
        flex-direction: column;
        gap: 0.8rem;
        padding: 1.4rem 1.1rem;
        border-radius: 12px;
        text-align: center;
    }

    .hm-bulk h2 {
        font-size: 1.08rem;
    }

    .hm-bulk-actions {
        flex-direction: column;
        width: 100%;
    }
}
