/**
 * TA — Home category blocks (front grid).
 * Parent header: diagonal gradient black → dark gold → #fab505 (shades of yellow + black).
 *
 * Stacking: PRS02043 home hooks use floats / absolute layers (e.g. cpcategorylist, cms banners).
 * This section clears floats, creates a BFC, and sits above typical sibling paint (z-index 2–10).
 */
.home-category-blocks {
    clear: both;
    position: relative;
    z-index: 15;
    isolation: isolate;
    display: flow-root;
    width: 100%;
    overflow: visible;
    padding: 2rem 0;
}

.home-category-blocks .home-cat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
}

@media (max-width: 991px) {
    .home-category-blocks .home-cat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .home-category-blocks .home-cat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .home-category-blocks .home-cat-grid {
        grid-template-columns: 1fr;
    }
}

.home-category-blocks .home-cat-block-inner {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    min-height: 11.5rem;
    height: 100%;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-category-blocks .home-cat-block-inner:hover {
    border-color: rgba(250, 181, 5, 0.55);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

/* Parent category — centered title; many #fab505 shades; #1a1a2e only on the far edge */
.home-category-blocks .home-cat-title {
    margin: 0;
    padding: 0.95rem 1.15rem;
    min-height: 3.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.9375rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.25;
    border-bottom: 2px solid rgba(26, 26, 46, 0.22);
    background: linear-gradient(
        135deg,
        #fffef4 0%,
        #fff6c8 8%,
        #ffeeb8 14%,
        #fde9a0 20%,
        #fce090 26%,
        #fcd35a 32%,
        #fab505 44%,
        #f2ae04 52%,
        #e8a704 60%,
        #dc9e04 68%,
        #d9a504 74%,
        #c99204 80%,
        #b88304 86%,
        #a57508 90%,
        #8f6812 93%,
        #5c4f2a 96%,
        #3a3842 98%,
        #1a1a2e 100%
    );
    color: #1a1a2e;
}

.home-category-blocks .home-cat-title a {
    color: #1a1a2e;
    text-decoration: none;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.65),
        0 0 1px rgba(255, 255, 255, 0.45);
}

.home-category-blocks .home-cat-title a:hover,
.home-category-blocks .home-cat-title a:focus {
    color: #121221;
    text-decoration: none;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.85),
        0 0 14px rgba(255, 255, 255, 0.4);
}

.home-category-blocks .home-cat-title a:focus-visible {
    outline: 2px solid #1a1a2e;
    outline-offset: 2px;
}

/* Subcategories — left-aligned, bold links, angle-right before each child */
.home-category-blocks .home-subcat-list {
    flex: 1;
    list-style: none;
    margin: 0;
    padding: 1rem 1.15rem 1.15rem;
    font-size: 0.875rem;
    line-height: 1.5;
    text-align: left;
    background: linear-gradient(180deg, #fdfaf3 0%, #fffaf0 35%, #ffffff 100%);
}

.home-category-blocks .home-subcat-list li {
    margin: 0 0 0.4rem;
}

.home-category-blocks .home-subcat-list li:last-child {
    margin-bottom: 0;
}

/* Shared child link: home blocks + category page 3-column grid */
a.ta-cat-child-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    overflow: visible;
    font-weight: 400;
    color: #1a1a2e;
    text-decoration: none;
    max-width: 100%;
}

a.ta-cat-child-link::before {
    content: "";
    display: block;
    flex-shrink: 0;
    width: 0.45em;
    height: 0.45em;
    box-sizing: border-box;
    margin-top: 0.12em;
    border-right: 2px solid #fab505;
    border-bottom: 2px solid #fab505;
    transform: rotate(-45deg);
    transform-origin: 50% 50%;
}

a.ta-cat-child-link:hover,
a.ta-cat-child-link:focus {
    color: #000000;
    text-decoration: underline;
    text-decoration-color: rgba(250, 181, 5, 0.9);
}

a.ta-cat-child-link:hover::before,
a.ta-cat-child-link:focus::before {
    border-right-color: #e0a204;
    border-bottom-color: #e0a204;
}

.home-category-blocks .home-subcat-more a {
    font-style: italic;
    color: #8a6a00;
    font-weight: 600;
}

.home-category-blocks .home-subcat-more a:hover {
    color: #fab505;
}

/* ── Category page: replace default subcategories with one 3-column block (no inner borders) */
body#category #main #subcategories {
    display: none !important;
}

.ta-cat-page-children {
    clear: both;
    width: 100%;
    margin: 0 0 1.25rem;
    position: relative;
}

/*
 * Category page card: height follows content (rows), not home card min-height / height:100% / flex-fill.
 */
.ta-cat-page-children .home-cat-block-inner {
    min-height: 0;
    height: auto;
    align-self: flex-start;
}

.ta-cat-page-children__body {
    flex: 0 1 auto;
    min-height: 0;
    width: 100%;
    background: linear-gradient(180deg, #fdfaf3 0%, #fffaf0 35%, #ffffff 100%);
}

/* Category child list: never more than 3 columns; extra items wrap to new rows */
.ta-cat-page-children__grid {
    list-style: none;
    margin: 0;
    padding: 1rem 1.25rem 1.15rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 1.5rem;
    row-gap: 0.5rem;
    text-align: left;
    align-items: start;
}

.ta-cat-page-children__cell {
    margin: 0;
    min-width: 0;
}

@media (max-width: 767px) {
    .ta-cat-page-children__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .ta-cat-page-children__grid {
        grid-template-columns: 1fr;
    }
}

/* Category page: hide #products when TA child-category block is shown (non-leaf with active children) */
#main .ta-categoryblocks--hide-product-listing {
    display: none !important;
}
