/* Trang chủ (Areas/Core/Views/Home/Index.cshtml). Dùng chung biến màu với search.css. */

.hm {
    background: #fff;
    color: var(--dt-text, #1f1f1f);
}

.hm-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
}

/* ---------------------------------------------------------------- banner + tìm kiếm */

/* Không đặt display cho ảnh: slide có 2 bản ảnh (desktop "hidden lg:block", mobile "block lg:hidden")
   và nút mũi tên; đặt display ở đây sẽ làm hiện cả hai bản, gây lặp slide. */
.hm-banner .swiper-slide img {
    width: 100%;
    height: auto;
}

.hm-search {
    position: relative;
    z-index: 5;
}

.hm-search__card {
    margin-top: 12px;
    padding: 16px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .08);
    border: 1px solid #f0f0f0;
}

.hm-search__title {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 700;
}

.hm-search__box {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 50px;
    padding: 0 6px 0 16px;
    border: 1px solid #e3e3e3;
    border-radius: 25px;
    background: #f7f7f8;
    color: #777;
    font: inherit;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
}

.hm-search__box > span:first-of-type {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hm-search__box svg circle,
.hm-search__box svg path,
.hm-chip svg path,
.hm-chip svg circle,
.hm-area__head svg path,
.hm-area__head svg circle {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.hm-search__go {
    flex: 0 0 auto;
    height: 38px;
    padding: 0 16px;
    border-radius: 19px;
    background: var(--dt-primary, #F44055);
    color: #fff;
    font-weight: 700;
    line-height: 38px;
}

.hm-search__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 4px;
}

.hm-cats {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.hm-cats::-webkit-scrollbar {
    display: none;
}

.hm-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid #e6e6e6;
    border-radius: 18px;
    background: #fff;
    color: var(--dt-text, #1f1f1f);
    font: inherit;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.hm-chip:hover {
    border-color: var(--dt-primary, #F44055);
    color: var(--dt-primary, #F44055);
}

.hm-chip--cat {
    background: #fff5f6;
    border-color: #ffd9de;
}

/* ---------------------------------------------------------------- khối nội dung */

.hm-section {
    padding: 28px 0;
}

.hm-section--soft {
    background: #f7f7f8;
}

.hm-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.hm-section__head h2 {
    margin: 0;
    font-size: 21px;
    font-weight: 700;
}

.hm-more {
    flex: 0 0 auto;
    color: var(--dt-primary, #F44055);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.hm-center {
    margin-top: 18px;
    text-align: center;
}

.hm-button {
    display: inline-block;
    padding: 12px 26px;
    border: 0;
    border-radius: 24px;
    background: var(--dt-primary, #F44055);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.hm-button:hover {
    color: #fff;
    filter: brightness(.95);
}

.hm-button--full {
    width: 100%;
}

.hm-empty {
    color: #777;
}

/* Tin mới đăng: 1 cột trên điện thoại, 2 cột trên màn hình lớn (thẻ tin dùng product-card.css) */
.hm-listings {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.hm-listings > * {
    min-width: 0;
}

/* ---------------------------------------------------------------- khu vực */

.hm-areas {
    display: grid;
    gap: 14px;
}

.hm-area {
    padding: 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #ececec;
}

.hm-area__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--dt-text, #1f1f1f);
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
}

.hm-area__head svg {
    color: #f07c22;
}

.hm-area__all {
    margin-left: auto;
    color: var(--dt-primary, #F44055);
    font-size: 14px;
    font-weight: 600;
}

.hm-area__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---------------------------------------------------------------- giới thiệu */

.hm-about {
    max-width: 860px;
    margin: 0 auto;
    font-size: 16px;
    line-height: 1.7;
    text-align: center;
    color: #444;
}

.hm-about img {
    max-width: 100%;
    height: auto;
}

/* ---------------------------------------------------------------- tin tức + tư vấn */

.hm-split {
    display: grid;
    gap: 24px;
}

.hm-news {
    display: grid;
    gap: 14px;
}

.hm-news a {
    color: inherit;
    text-decoration: none;
}

.hm-news h3 {
    margin: 0;
    font-weight: 700;
    color: var(--dt-text, #1f1f1f);
}

.hm-news time {
    font-size: 13px;
    color: #888;
}

.hm-news__lead {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #ececec;
}

.hm-news__img {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #eee;
}

.hm-news__img img,
.hm-news__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}

.hm-news__lead:hover img,
.hm-news__item:hover img {
    transform: scale(1.04);
}

.hm-news__lead-body {
    padding: 12px 14px 14px;
}

.hm-news__lead-body h3 {
    margin: 4px 0 6px;
    font-size: 17px;
    line-height: 1.4;
}

.hm-news__lead-body p {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: #555;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hm-news__list {
    display: grid;
    gap: 12px;
}

.hm-news__item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.hm-news__thumb {
    flex: 0 0 110px;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    overflow: hidden;
    background: #eee;
}

.hm-news__item h3 {
    margin-bottom: 4px;
    font-size: 15px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hm-news__item:hover h3,
.hm-news__lead:hover h3 {
    color: var(--dt-primary, #F44055);
}

.hm-consult {
    padding: 18px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #ececec;
}

.hm-consult h2 {
    margin: 0 0 4px;
    font-size: 21px;
    font-weight: 700;
}

.hm-consult > p {
    margin: 0 0 14px;
    font-size: 14px;
    color: #666;
}

.hm-consult label {
    display: block;
    margin-bottom: 12px;
}

.hm-consult label span {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 600;
}

.hm-consult input,
.hm-consult textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
    font: inherit;
    font-size: 16px; /* không để iOS phóng to khi nhập */
    color: var(--dt-text, #1f1f1f);
    outline: none;
}

.hm-consult input:focus,
.hm-consult textarea:focus {
    border-color: var(--dt-primary, #F44055);
    box-shadow: 0 0 0 3px rgba(244, 64, 85, .12);
}

/* ---------------------------------------------------------------- màn hình lớn */

@media (min-width: 768px) {
    .hm-search__card {
        margin-top: -46px;
        padding: 22px 24px;
    }

    .hm-search__title {
        font-size: 20px;
    }

    .hm-search__box {
        height: 56px;
        font-size: 16px;
    }

    .hm-section {
        padding: 44px 0;
    }

    .hm-section__head h2 {
        font-size: 26px;
    }

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

    .hm-news {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
        align-items: start;
    }
}

@media (min-width: 1024px) {
    .hm-listings {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 18px;
    }

    .hm-split {
        grid-template-columns: minmax(0, 1fr) 360px;
        align-items: start;
        gap: 32px;
    }

    .hm-consult {
        position: sticky;
        top: 90px;
    }
}
