:root {
    --gap: 22px;
    --label-h: 30px;
    --radius: 3px;
    --border-w: 1px;
}

.free_cat_home_sections_wrapper,
.free_cat_home_sections {
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

.free_cat_home_sections {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-flow: row dense;
    grid-auto-rows: 1fr;
    gap: var(--gap);
    align-items: stretch;
}

.cat_home_item {
    position: relative;
    display: block; 
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    box-sizing: border-box;
    border-radius: var(--radius);
    border: var(--border-w) solid #333;
    background: #333;
    direction: rtl;
    transition: transform .25s ease, box-shadow .25s ease;
}

.cat_home_img {
    position: relative;
    width: 100%;
    height: 100%;
}

.cat_home_img_container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.cat_home_img_container img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity .9s ease, transform .35s ease;
}
.img-primary {
    opacity: 1;
    z-index: 1;
}

.img-secondary {
    opacity: 0;
    z-index: 0;
    pointer-events: none;
}

.cat_home_item.is-swapped .img-primary {
    opacity: 0;
}

.cat_home_item.is-swapped .img-secondary {
    opacity: 1;
}
.cat_home_content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--label-h);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #333;
    z-index: 2;
    backdrop-filter: blur(2px);
}
.cat_home_name {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;
    text-align: center;


}
.cat_home_name span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .6s ease;
}

.title-primary { opacity: 1; }
.title-secondary { opacity: 0; }

.cat_home_item.is-swapped .title-primary { opacity: 0; }
.cat_home_item.is-swapped .title-secondary { opacity: 1; }

/* ========= Hover ========= */
@media (hover: hover) {
    .cat_home_item:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 30px rgba(0,0,0,.18);
    }

    .cat_home_item:hover img {
        transform: scale(1.05);
    }
}

/* =========================================================
   NEW LAYOUT:
   [ Ãƒâ€”Ã‚Â§Ãƒâ€”Ã‹Å“Ãƒâ€”Ã…Â¸ ] [ Ãƒâ€”Ã¢â‚¬â„¢Ãƒâ€”Ã¢â‚¬Å“Ãƒâ€”Ã¢â‚¬Â¢Ãƒâ€”Ã…â€œ ] [ Ãƒâ€”Ã‚Â§Ãƒâ€”Ã‹Å“Ãƒâ€”Ã…Â¸ ] [ Ãƒâ€”Ã¢â‚¬â„¢Ãƒâ€”Ã¢â‚¬Å“Ãƒâ€”Ã¢â‚¬Â¢Ãƒâ€”Ã…â€œ ] [ Ãƒâ€”Ã‚Â§Ãƒâ€”Ã‹Å“Ãƒâ€”Ã…Â¸ ]
   [ Ãƒâ€”Ã‚Â§Ãƒâ€”Ã‹Å“Ãƒâ€”Ã…Â¸ ] [ Ãƒâ€”Ã¢â‚¬â„¢Ãƒâ€”Ã¢â‚¬Å“Ãƒâ€”Ã¢â‚¬Â¢Ãƒâ€”Ã…â€œ ] [ Ãƒâ€”Ã‚Â§Ãƒâ€”Ã‹Å“Ãƒâ€”Ã…Â¸ ] [ Ãƒâ€”Ã¢â‚¬â„¢Ãƒâ€”Ã¢â‚¬Å“Ãƒâ€”Ã¢â‚¬Â¢Ãƒâ€”Ã…â€œ ] [ Ãƒâ€”Ã‚Â§Ãƒâ€”Ã‹Å“Ãƒâ€”Ã…Â¸ ]
========================================================= */

/* ===== COLUMN 2 (LEFT BIG) ===== */
.free_cat_home_sections > .cat_home_item:nth-child(1) {
    grid-column: 2;
    grid-row: 1 / 3;
    aspect-ratio: auto;
}

/* ===== COLUMN 3 (CENTER SMALLS) ===== */
.free_cat_home_sections > .cat_home_item:nth-child(2) {
    grid-column: 3;
    grid-row: 1;
}

.free_cat_home_sections > .cat_home_item:nth-child(3) {
    grid-column: 3;
    grid-row: 2;
}

/* ===== COLUMN 4 (RIGHT BIG) ===== */
.free_cat_home_sections > .cat_home_item:nth-child(4) {
    grid-column: 4;
    grid-row: 1 / 3;
    aspect-ratio: auto;
}

/* ===== RIGHT SIDE ===== */
.free_cat_home_sections > .cat_home_item:nth-child(5) {
    grid-column: 5;
    grid-row: 1;
}

.free_cat_home_sections > .cat_home_item:nth-child(6) {
    grid-column: 5;
    grid-row: 2;
}

/* ===== LEFT SIDE ===== */
.free_cat_home_sections > .cat_home_item:nth-child(7) {
    grid-column: 1;
    grid-row: 1;
}

.free_cat_home_sections > .cat_home_item:nth-child(8) {
    grid-column: 1;
    grid-row: 2;
}

/* ========= Tablet ========= */
@media (max-width: 1023px) {
    .free_cat_home_sections {
        grid-template-columns: repeat(4, 1fr);
    }

    .cat_home_item {
        aspect-ratio: 1 / 1 !important;
        grid-column: auto !important;
        grid-row: auto !important;
    }
}

/* ========= Mobile ========= */
@media (max-width: 768px) {
    .free_cat_home_sections {
        grid-template-columns: repeat(2, 1fr);
    }
}