/* ============================================================
   IN AN HOANG NAM
   HOMEPAGE CATEGORY
   FILE: category-home.css
   ============================================================ */

.inh-home-category {
    width: 100%;
    padding: 12px 0 40px;
    box-sizing: border-box;
}


/* ============================================================
   CONTAINER
   ============================================================ */

.inh-home-category-container {
    width: calc(100% - 24px);
    max-width: 1280px;

    margin: 0 auto;

    background: #ffffff;

    border: 1px solid #eeeeee;
    border-radius: 8px;

    overflow: hidden;

    box-sizing: border-box;
}


/* ============================================================
   HEADER
   ============================================================ */

.inh-home-category-header {
    position: relative;

    padding: 18px 20px 16px;

    box-sizing: border-box;
}


.inh-home-category-header::after {
    content: "";

    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    height: 2px;

    background: linear-gradient(
        to right,
        #C9A044 0%,
        #C9A044 20%,
        #E4B44B 20%,
        #E4B44B 50%,
        #ff9de2 50%,
        #ff9de2 70%,
        #CDA34A 70%,
        #CDA34A 100%
    );
}


/* ============================================================
   HEADING
   ============================================================ */

#inh-category-heading {
    margin: 0;

    font-size: 18px;
    font-weight: 500;

    line-height: 1.3;

    text-transform: uppercase;

    color: #0A306C;

    transition:
        color .25s ease;
}


/* ============================================================
   GRID
   10 DANH MỤC / HÀNG
   ============================================================ */

.inh-home-category-grid {
    display: grid;

    grid-template-columns:
        repeat(10, minmax(0, 1fr));

    width: 100%;

    box-sizing: border-box;
}


/* ============================================================
   ITEM
   ============================================================ */

.inh-home-category-item {
    position: relative;

    min-width: 0;

    padding: 20px 12px 22px;

    border-right: 1px solid #eeeeee;
    border-bottom: 1px solid #eeeeee;

    box-sizing: border-box;

    transition:
        background-color .25s ease;
}


/*
 * Cột cuối không cần border-right
 */

.inh-home-category-item:nth-child(10n) {
    border-right: 0;
}


/*
 * Mỗi hàng cuối không cần border-bottom
 *
 * 10 item / hàng.
 */

.inh-home-category-item:nth-last-child(-n + 10) {
    border-bottom: 0;
}


/* ============================================================
   HOVER ITEM
   ============================================================ */

.inh-home-category-item:hover {
    background: #ffffff;
}


/* ============================================================
   LINK
   ============================================================ */

.inh-home-category-link {
    display: block;

    width: 100%;

    margin: 0;
    padding: 0;

    color: inherit;

    text-decoration: none;

    box-sizing: border-box;
}


.inh-home-category-link:hover,
.inh-home-category-link:focus {
    color: inherit;

    text-decoration: none;
}


/* ============================================================
   IMAGE
   ============================================================ */

.inh-home-category-image {
    width: 100%;

    /*
     * Giữ ảnh vuông nhưng có khoảng đệm
     * do item đã có padding.
     */

    aspect-ratio: 1 / 1;

    display: flex;

    align-items: center;
    justify-content: center;

    overflow: hidden;

    border-radius: 12px;

    background: #f7f7f7;

    box-sizing: border-box;
}


/* ============================================================
   IMAGE IMG
   ============================================================ */

.inh-home-category-image img {
    display: block;

    width: 100%;
    height: 100%;

    max-width: none;

    margin: 0;
    padding: 0;

    object-fit: contain;

    transform: scale(1);

    transition:
        transform .35s ease;
}


/* ============================================================
   IMAGE HOVER
   ============================================================ */

.inh-home-category-item:hover
.inh-home-category-image img {
    transform: scale(1.05);
}


/* ============================================================
   NO IMAGE
   ============================================================ */

.inh-home-category-no-image {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    color: #999999;

    font-size: 12px;

    text-align: center;
}


/* ============================================================
   INFO
   ============================================================ */

.inh-home-category-info {
    padding-top: 12px;

    text-align: center;

    box-sizing: border-box;
}


/* ============================================================
   TITLE
   ============================================================ */

.inh-home-category-title {
    margin: 0;

    color: #222222;

    font-size: 14px;
    font-weight: 600;

    line-height: 1.4;

    text-align: center;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

    transition:
        color .25s ease;
}


/* ============================================================
   TITLE HOVER
   ============================================================ */

.inh-home-category-item:hover
.inh-home-category-title {
    color: #0A306C;
}


/* ============================================================
   TABLET
   5 / HÀNG
   ============================================================ */

@media (max-width: 1199px) {

    .inh-home-category-grid {
        grid-template-columns:
            repeat(5, minmax(0, 1fr));
    }


    .inh-home-category-item {
        padding: 20px 14px 22px;
    }


    /*
     * Cột cuối mỗi hàng
     */

    .inh-home-category-item:nth-child(10n) {
        border-right: 1px solid #eeeeee;
    }


    .inh-home-category-item:nth-child(5n) {
        border-right: 0;
    }


    /*
     * Không bỏ border-bottom ở 10 item cuối nữa.
     */

    .inh-home-category-item:nth-last-child(-n + 10) {
        border-bottom: 1px solid #eeeeee;
    }


    /*
     * 5 item cuối là hàng cuối.
     */

    .inh-home-category-item:nth-last-child(-n + 5) {
        border-bottom: 0;
    }
}


/* ============================================================
   MOBILE
   2 / HÀNG
   ============================================================ */

@media (max-width: 767px) {

    .inh-home-category {
        padding: 8px 0 30px;
    }


    .inh-home-category-container {
        width: calc(100% - 12px);

        border-radius: 6px;
    }


    .inh-home-category-header {
        padding: 15px 14px 13px;
    }


    #inh-category-heading {
        font-size: 16px;
    }


    .inh-home-category-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }


    .inh-home-category-item {
        padding: 16px 10px 18px;
    }


    /*
     * Cột cuối
     */

    .inh-home-category-item:nth-child(5n) {
        border-right: 1px solid #eeeeee;
    }


    .inh-home-category-item:nth-child(2n) {
        border-right: 0;
    }


    /*
     * Xóa border-bottom cũ
     */

    .inh-home-category-item:nth-last-child(-n + 5) {
        border-bottom: 1px solid #eeeeee;
    }


    /*
     * Hàng cuối 2 item
     */

    .inh-home-category-item:nth-last-child(-n + 2) {
        border-bottom: 0;
    }


    .inh-home-category-image {
        border-radius: 10px;
    }


    .inh-home-category-info {
        padding-top: 10px;
    }


    .inh-home-category-title {
        font-size: 13px;
    }
}


/* ============================================================
   VERY SMALL MOBILE
   ============================================================ */

@media (max-width: 480px) {

    .inh-home-category-item {
        padding: 12px 8px 16px;
    }


    .inh-home-category-title {
        font-size: 12px;
    }


    .inh-home-category-info {
        padding-top: 8px;
    }
}

.inh-home-category {
    width: 100vw;

    position: relative;

    left: 50%;

    transform: translateX(-50%);

    padding: 0 8px;
}

.inh-home-category-container {
    width: 100%;

    max-width: 1445px;

    margin: 0 auto;
}

@media (max-width: 1440px) {

    .inh-home-category {
        padding: 0 4px;
    }

    .inh-home-category-container {
        max-width: 100%;
    }
}

@media (min-width: 1920px) {

    .inh-home-category-container {
        max-width: 1445px;
    }
}