/* =========================================================
   MOTOX - CATEGORY (trang chủ)
   1. Thanh tiêu đề section + "Xem thêm"
   2. Lưới danh mục dưới banner (layout a4)
   ========================================================= */

.category-bar-container,
.category-grids-home {
    --cat-ink: #111;
    --cat-muted: #6b6b6b;
    --cat-red: #D52927;
    --cat-line: #e3e3e3;
    --cat-bg: #f3f3f1;
    --cat-bg-hover: #ececea;
    --cat-radius: 10px;
    --cat-gap: 16px;
    --cat-display: "Anton", "Arial Narrow", sans-serif;
    /* Mũi tên dùng chung cho "Xem thêm" và ô danh mục */
    --cat-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 14' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 7h23M18 1l6 6-6 6'/%3E%3C/svg%3E");
}


/* =========================================================
   1. THANH TIÊU ĐỀ SECTION
   [// sọc đỏ] TIÊU ĐỀ ———————————————— XEM THÊM →
   ========================================================= */

.category-bar-container {
    position: relative;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 24px !important;
    width: 100%;
    height: auto !important;
    margin: 40px 0 24px !important;
    padding: 0 !important;
    background: transparent;
    z-index: 1;
}

/* Đường kẻ nối tiêu đề với "Xem thêm" */
.category-bar-container::after {
    content: "";
    order: 1;
    flex: 1 1 auto;
    height: 1px;
    background: var(--cat-line);
}

/* --- Tiêu đề --- */
.category-bar-container .category-title {
    order: 0;
    position: relative;
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 0 0 30px !important;
    overflow: visible;
    color: var(--cat-ink);
}

/* Bỏ khối đỏ nghiêng cũ, thay bằng 2 sọc vát kiểu xe đua */
.category-bar-container .category-title::before,
.category-bar-container .category-title::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 7px !important;
    height: 26px;
    background: var(--cat-red);
    transform: translateY(-50%) skewX(-18deg);
    transform-origin: center;
    transition: opacity .3s ease, transform .3s ease;
    z-index: 0;
}

.category-bar-container .category-title::after {
    left: 13px;
    opacity: .35;
}

.category-bar-container .category-title:hover::after {
    opacity: 1;
}

.category-bar-container .category-title h2,
.category-bar-container .category-title .elementor-heading-title {
    margin: 0 !important;
    line-height: 1 !important;
}

.category-bar-container .category-title a {
    position: relative;
    z-index: 1;
    display: inline-block;
    width: auto;
    padding: 0 !important;
    color: var(--cat-ink) !important;
    font-family: var(--cat-display) !important;
    font-size: 34px !important;
    font-style: italic;
    font-weight: 400 !important;
    letter-spacing: .01em;
    line-height: 1 !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    white-space: nowrap;
    transition: color .2s ease;
}

.category-bar-container .category-title a:hover {
    color: var(--cat-red) !important;
}

/* --- "Xem thêm" --- */
.category-bar-container .view-all-button {
    order: 2;
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    color: var(--cat-ink);
    z-index: 1;
}

/* Bỏ khối xám/đen nghiêng cũ */
.category-bar-container .view-all-button::before,
.category-bar-container .view-all-button::after {
    display: none !important;
    content: none !important;
}

.category-bar-container .view-all-button h2,
.category-bar-container .view-all-button .elementor-heading-title {
    margin: 0 !important;
    line-height: 1 !important;
}

.category-bar-container .view-all-button a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: auto;
    padding: 6px 0 !important;
    color: var(--cat-ink) !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-style: normal;
    font-weight: 700 !important;
    letter-spacing: .12em;
    line-height: 1.4 !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    white-space: nowrap;
    transition: color .2s ease;
}

.category-bar-container .view-all-button a::after {
    content: "";
    display: inline-block;
    flex-shrink: 0;
    width: 22px;
    height: 12px;
    background-color: currentColor;
    -webkit-mask: var(--cat-arrow) center / contain no-repeat;
            mask: var(--cat-arrow) center / contain no-repeat;
    transition: transform .3s ease;
}

.category-bar-container .view-all-button a:hover {
    color: var(--cat-red) !important;
}

.category-bar-container .view-all-button a:hover::after {
    transform: translateX(4px);
}


/* =========================================================
   2. LƯỚI DANH MỤC DƯỚI BANNER (layout a4)
   Ô nền xám, ảnh giữa, tên in hoa góc trái dưới, mũi tên góc phải
   ========================================================= */

.category-grids-home {
    --gap: var(--cat-gap) !important;
    --row-gap: var(--cat-gap) !important;
    --column-gap: var(--cat-gap) !important;
    gap: var(--cat-gap) !important;
}

/* Ô danh mục (là thẻ <a> vùng chứa) */
.category-grids-home .category-group-item {
    position: relative;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    gap: 0 !important;
    padding: 28px 28px 24px !important;
    background: var(--cat-bg) !important;
    border-radius: var(--cat-radius);
    overflow: hidden;
    text-decoration: none !important;
    transform: none !important;
    transition: background-color .3s ease;
}

.category-grids-home .category-group-item:hover {
    background: var(--cat-bg-hover) !important;
    transform: none !important;
}

/* Ảnh */
.category-grids-home .category-group-item .elementor-widget-image {
    width: 100%;
    margin: 0 !important;
}

.category-grids-home .category-group-item .elementor-widget-image img {
    display: block;
    width: 100%;
    max-width: 320px;
    height: auto;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    object-fit: contain;
    mix-blend-mode: multiply;
    transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}

.category-grids-home .category-group-item:hover .elementor-widget-image img {
    transform: scale(1.04);
}

/* Hàng tên danh mục + mũi tên */
.category-grids-home .category-group-item-title {
    position: relative;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    margin: 16px 0 0 !important;
    padding: 0 40px 0 0 !important;
}

.category-grids-home .category-group-item-title::before {
    display: none !important;
    content: none !important;
}

.category-grids-home .category-group-item-title h2,
.category-grids-home .category-group-item-title .elementor-heading-title,
.category-grids-home .category-group-item-title a {
    margin: 0 !important;
    color: var(--cat-ink) !important;
    font-family: inherit !important;
    font-size: 20px !important;
    font-style: normal !important;
    font-weight: 800 !important;
    letter-spacing: .01em;
    line-height: 1.2 !important;
    text-align: left !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    transition: color .2s ease;
}

.category-grids-home .category-group-item:hover .category-group-item-title h2,
.category-grids-home .category-group-item:hover .category-group-item-title .elementor-heading-title,
.category-grids-home .category-group-item:hover .category-group-item-title a {
    color: var(--cat-red) !important;
}

/* Mũi tên → góc phải, thẳng hàng với tên */
.category-grids-home .category-group-item-title::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    width: 26px;
    height: 14px;
    transform: translateY(-50%);
    background-color: var(--cat-ink);
    -webkit-mask: var(--cat-arrow) center / contain no-repeat;
            mask: var(--cat-arrow) center / contain no-repeat;
    transition: transform .3s ease, background-color .2s ease;
}

.category-grids-home .category-group-item:hover .category-group-item-title::after {
    background-color: var(--cat-red);
    transform: translate(5px, -50%);
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (min-width: 1024px) and (max-width: 1279px) {
    .category-grids-home {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .category-grids-home .category-group-item-title h2,
    .category-grids-home .category-group-item-title .elementor-heading-title,
    .category-grids-home .category-group-item-title a {
        font-size: 18px !important;
    }
}

@media (max-width: 1023px) {
    .category-bar-container .category-title a {
        font-size: 28px !important;
    }

    .category-grids-home {
        --cat-gap: 12px;
    }

    .category-grids-home .category-group-item {
        padding: 20px 20px 18px !important;
    }

    .category-grids-home .category-group-item-title h2,
    .category-grids-home .category-group-item-title .elementor-heading-title,
    .category-grids-home .category-group-item-title a {
        font-size: 16px !important;
    }
}

@media (max-width: 767px) {
    .category-bar-container {
        gap: 14px !important;
        margin: 28px 0 16px !important;
    }

    .category-bar-container .category-title {
        padding-left: 22px !important;
    }

    .category-bar-container .category-title::before,
    .category-bar-container .category-title::after {
        width: 5px !important;
        height: 18px;
    }

    .category-bar-container .category-title::after {
        left: 10px;
    }

    .category-bar-container .category-title a {
        font-size: 22px !important;
    }

    .category-bar-container .view-all-button a {
        font-size: 11px !important;
        letter-spacing: .08em;
        gap: 6px;
    }

    .category-bar-container .view-all-button a::after {
        width: 16px;
        height: 10px;
    }

    .category-grids-home {
        --cat-gap: 10px;
        --cat-radius: 8px;
    }

    .category-grids-home .category-group-item {
        padding: 14px !important;
    }

    .category-grids-home .category-group-item-title {
        margin-top: 10px !important;
        padding-right: 26px !important;
    }

    .category-grids-home .category-group-item-title h2,
    .category-grids-home .category-group-item-title .elementor-heading-title,
    .category-grids-home .category-group-item-title a {
        font-size: 13px !important;
    }

    .category-grids-home .category-group-item-title::after {
        width: 18px;
        height: 10px;
    }
}

/* Màn rất nhỏ: bỏ đường kẻ để tiêu đề dài không bị chật */
@media (max-width: 450px) {
    .category-bar-container::after {
        display: none;
    }

    .category-bar-container .category-title a {
        font-size: 20px !important;
        white-space: normal;
    }
}