/**
 * 2021 Anvanto
 *
 * NOTICE OF LICENSE
 *
 * This file is not open source! Each license that you purchased is only available for 1 wesite only.
 * If you want to use this file on more websites (or projects), you need to purchase additional licenses. 
 * You are not allowed to redistribute, resell, lease, license, sub-license or offer our resources to any third party.
 *
 *  @author Anvanto <anvantoco@gmail.com>
 *  @copyright  2021 Anvanto
 *  @license    Valid for 1 website (or project) for each purchase of license
 *  International Registered Trademark & Property of Anvanto
 */

.an_homecategories {
    margin-bottom: 30px;
}
.an_homecategories-head {
    margin-bottom: 30px;
}
.an_homecategories-head .an_homecategories-title {
    margin: 0 0 10px;
    text-align: center;
}
.an_homecategories-head p:not(.an_homecategories-title) {
    text-align: center;
}
.an_homecategories-list {
    display: flex;
    justify-content: center;
    margin: 0 -15px;
}
.an_homecategories-slider {
    margin: 0;
}
.an_homecategories-item {
    position: relative;
    overflow: hidden;
}
.an_homecategories-item {
    display: block;
    max-width: 442px;
    width: 100%;
    position: relative;
    margin: 0 15px 30px;

}
.an_homecategories-slider .an_homecategories-item {
    margin: 0 auto 30px;
}
.an_homecategories-item .an_homecategories-image {
    display: flex;
    justify-content: center;
    align-items: center;
}
.an_homecategories-item .an_homecategories-image img {
    max-width: 100%;
    height: auto;
}
.an_homecategories-item-desc {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.an_homecategories-item-desc .h2 {
    max-width: 100%;
    width: 250px;
    min-height: 63px;
    padding: 10px 15px 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #000;
    font-size: 11px;
    text-transform: uppercase;
    margin: 0;
    text-align: center;
    line-height: 1.2;
}
.an_homecategories-item-desc p:not(.h2) {
    margin-bottom: 0;
    text-align: center;
}
.an_homecategories .owl-carousel .owl-item img {
    width: auto;
    max-width: 100%;
}
.an_homecategories .owl-dots {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.an_homecategories .owl-dots .owl-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    margin: 5px;
}
.an_homecategories .owl-dots .owl-dot.active,
.an_homecategories .owl-dots .owl-dot:hover {
    background: #000;
}
.an_homecategories .an_homecategories-nav {
    display: flex;
    justify-content: center;
}
.an_homecategories .an_homecategories-nav .owl-prev,
.an_homecategories .an_homecategories-nav .owl-next {
    margin: 5px;
}
.an_homecategories .an_homecategories-nav .disabled i {
    opacity: .5;
    cursor: no-drop;
}
.an_homecategories .an_homecategories-nav i {
    background: #ddd;
    border-radius: 50%;
    cursor: pointer;
    font-size: 21px;
    height: 35px;
    line-height: 35px;
    width: 35px;
    text-align: center;
}
.an_homecategories .an_homecategories-nav i:hover {
    background: #000;
    color: #fff;
}
/*** effects ***/
.an_homecategories-item .an_homecategories-image {
    position: relative;
    overflow: hidden;
}
.an_homecategories-item .an_homecategories-image::before {
    position: absolute;
    top: 0;
    left: -75%;
    z-index: 2;
    display: block;
    content: '';
    width: 50%;
    height: 100%;
    background: -webkit-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,.5) 100%);
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,.5) 100%);
    -webkit-transform: skewX(-25deg);
    transform: skewX(-25deg);
}
.an_homecategories-item:hover .an_homecategories-image::before {
    -webkit-animation: shine .75s;
    animation: shine .75s;
}
@-webkit-keyframes shine {
    100% {
        left: 125%;
    }
}
@keyframes shine {
    100% {
        left: 125%;
    }
}
@media (max-width: 1200px) {
    .an_homecategories-list {
        flex-wrap: wrap;
    }
}
/*** grid display mode ***/
.an_homecategories-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
    margin: 0;
    justify-content: stretch;
}
.an_homecategories-grid .an_homecategories-item {
    max-width: none;
    width: auto;
    margin: 0;
}
/* skaluj etykiete proporcjonalnie do mniejszego itemu w gridzie */
.an_homecategories-grid .an_homecategories-item-desc {
    bottom: 8px;
}
.an_homecategories-grid .an_homecategories-item-desc .h2 {
    width: 75%;
    max-width: 75%;
    min-height: 0;
    padding: 6px 10px;
    font-size: 10px;
}
@media (min-width: 768px) {
    .an_homecategories-grid .an_homecategories-item-desc {
        bottom: 12px;
    }
    .an_homecategories-grid .an_homecategories-item-desc .h2 {
        padding: 8px 12px;
        font-size: 11px;
    }
}
@media (min-width: 1200px) {
    .an_homecategories-grid .an_homecategories-item-desc {
        bottom: 16px;
    }
    .an_homecategories-grid .an_homecategories-item-desc .h2 {
        width: 70%;
        max-width: 70%;
        padding: 10px 15px;
        font-size: 11px;
    }
}
/* Mobile: 2 per row */
.an_homecategories-grid > * {
    grid-column: span 6;
}
/* Mobile: center solo last item on odd counts */
.an_homecategories-grid[data-count="3"] > :nth-child(3),
.an_homecategories-grid[data-count="5"] > :nth-child(5),
.an_homecategories-grid[data-count="7"] > :nth-child(7),
.an_homecategories-grid[data-count="9"] > :nth-child(9) {
    grid-column: 4 / span 6;
}
/* Tablet 768-1199px */
@media (min-width: 768px) and (max-width: 1199px) {
    .an_homecategories-grid > * { grid-column: span 4; }
    .an_homecategories-grid[data-count="3"] > :nth-child(3),
    .an_homecategories-grid[data-count="5"] > :nth-child(5),
    .an_homecategories-grid[data-count="7"] > :nth-child(7),
    .an_homecategories-grid[data-count="9"] > :nth-child(9) {
        grid-column: span 4;
    }
    .an_homecategories-grid[data-count="2"] > * { grid-column: span 6; }
    .an_homecategories-grid[data-count="4"] > * { grid-column: span 6; }
    .an_homecategories-grid[data-count="5"] > :nth-child(4) { grid-column: 3 / span 4; }
    .an_homecategories-grid[data-count="5"] > :nth-child(5) { grid-column: 7 / span 4; }
    .an_homecategories-grid[data-count="7"] > :nth-child(7) { grid-column: 5 / span 4; }
    .an_homecategories-grid[data-count="8"] > :nth-child(7) { grid-column: 3 / span 4; }
    .an_homecategories-grid[data-count="8"] > :nth-child(8) { grid-column: 7 / span 4; }
}
/* Desktop >=1200px */
@media (min-width: 1200px) {
    .an_homecategories-grid > * { grid-column: span 3; }
    .an_homecategories-grid[data-count="3"] > :nth-child(3),
    .an_homecategories-grid[data-count="5"] > :nth-child(5),
    .an_homecategories-grid[data-count="7"] > :nth-child(7),
    .an_homecategories-grid[data-count="9"] > :nth-child(9) {
        grid-column: span 3;
    }
    .an_homecategories-grid[data-count="2"] > * { grid-column: span 6; }
    .an_homecategories-grid[data-count="3"] > * { grid-column: span 4; }
    .an_homecategories-grid[data-count="4"] > * { grid-column: span 3; }
    .an_homecategories-grid[data-count="5"] {
        grid-template-columns: repeat(5, 1fr);
    }
    .an_homecategories-grid[data-count="5"] > *,
    .an_homecategories-grid[data-count="5"] > :nth-child(4),
    .an_homecategories-grid[data-count="5"] > :nth-child(5) {
        grid-column: auto;
    }
}
/*** list display mode ***/
/* Visibility helpers - tylko display:none z !important (zeby naturalny display grid/flex zostal zachowany na widocznych blokach) */
@media (max-width: 767px) {
    .an_homecategories-tablet-only,
    .an_homecategories-desktop-only { display: none !important; }
}
@media (min-width: 768px) and (max-width: 1199px) {
    .an_homecategories-mobile-only,
    .an_homecategories-desktop-only,
    .an_homecategories-hide-tablet { display: none !important; }
}
@media (min-width: 1200px) {
    .an_homecategories-mobile-only,
    .an_homecategories-tablet-only,
    .an_homecategories-hide-desktop { display: none !important; }
}

.an_homecategories-listview {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 0;
    justify-content: stretch;
}
.an_homecategories-listview .an_homecategories-item {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    max-width: none;
    width: 100%;
    margin: 0;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.an_homecategories-listview .an_homecategories-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.an_homecategories-listview .an_homecategories-image {
    flex: 0 0 auto;
    width: var(--an-hc-list-img-w, 150px);
    aspect-ratio: var(--an-hc-list-img-ratio, 1/1);
    height: auto;
    margin: 0;
    overflow: hidden;
    background: #f4f4f4;
}
.an_homecategories-listview .an_homecategories-image img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    display: block;
}
.an_homecategories-listview .an_homecategories-item-desc {
    position: static;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 14px 18px;
    text-align: left;
    background: #fff;
}
.an_homecategories-listview .an_homecategories-item-title {
    width: auto;
    max-width: 100%;
    min-height: 0;
    background: transparent;
    padding: 0;
    margin: 0 0 6px;
    font-size: 14px;
    text-transform: uppercase;
    text-align: left;
    color: inherit;
    display: block;
    letter-spacing: 0.04em;
    font-weight: 600;
}
.an_homecategories-listview .an_homecategories-item-text {
    font-size: 13px;
    line-height: 1.5;
    color: #555;
    margin: 0 0 10px;
}
.an_homecategories-listview .an_homecategories-item-text p {
    margin: 0 0 6px;
    text-align: left;
}
.an_homecategories-listview .an_homecategories-item-btn {
    display: inline-block;
    margin-top: auto;
    padding: 6px 14px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid currentColor;
    border-radius: 3px;
    align-self: flex-start;
}
.an_homecategories-listview .an_homecategories-item:hover .an_homecategories-item-btn {
    background: #000;
    color: #fff;
    border-color: #000;
}
.an_homecategories-listview .an_homecategories-image::before {
    display: none;
}

/* Tablet 768-1199px - uses data-cols-tablet, 12-col grid */
@media (min-width: 768px) and (max-width: 1199px) {
    .an_homecategories-listview {
        grid-template-columns: repeat(12, 1fr);
        gap: 20px;
    }
    .an_homecategories-listview .an_homecategories-image {
        width: var(--an-hc-list-img-w-desktop, 220px);
    }
    .an_homecategories-listview .an_homecategories-item {
        max-width: var(--an-hc-list-item-max, none);
    }
    .an_homecategories-listview .an_homecategories-item-title { font-size: 15px; }

    /* cols default spans */
    .an_homecategories-listview[data-cols-tablet="auto"] {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
    .an_homecategories-listview[data-cols-tablet="auto"] > * { grid-column: auto; }
    .an_homecategories-listview[data-cols-tablet="1"] > * { grid-column: span 12; }
    .an_homecategories-listview[data-cols-tablet="1"] .an_homecategories-item { max-width: none; }
    .an_homecategories-listview[data-cols-tablet="2"] > * { grid-column: span 6; }
    .an_homecategories-listview[data-cols-tablet="3"] > * { grid-column: span 4; }
    .an_homecategories-listview[data-cols-tablet="4"] > * { grid-column: span 3; }

    /* cols=2: orphan-of-1 (N=3,5,7,9) */
    .an_homecategories-listview[data-cols-tablet="2"][data-count="3"] > :nth-child(3),
    .an_homecategories-listview[data-cols-tablet="2"][data-count="5"] > :nth-child(5),
    .an_homecategories-listview[data-cols-tablet="2"][data-count="7"] > :nth-child(7),
    .an_homecategories-listview[data-cols-tablet="2"][data-count="9"] > :nth-child(9) {
        grid-column: 4 / span 6;
    }
    /* cols=3: N=4 force 2+2 */
    .an_homecategories-listview[data-cols-tablet="3"][data-count="4"] > * { grid-column: span 6; }
    /* cols=3: N=5 -> 3+2 centered */
    .an_homecategories-listview[data-cols-tablet="3"][data-count="5"] > :nth-child(4) { grid-column: 3 / span 4; }
    .an_homecategories-listview[data-cols-tablet="3"][data-count="5"] > :nth-child(5) { grid-column: 7 / span 4; }
    /* cols=3: N=7 -> 3+3+1 centered */
    .an_homecategories-listview[data-cols-tablet="3"][data-count="7"] > :nth-child(7) { grid-column: 5 / span 4; }
    /* cols=3: N=8 -> 3+3+2 centered */
    .an_homecategories-listview[data-cols-tablet="3"][data-count="8"] > :nth-child(7) { grid-column: 3 / span 4; }
    .an_homecategories-listview[data-cols-tablet="3"][data-count="8"] > :nth-child(8) { grid-column: 7 / span 4; }
    /* cols=3: N=10 -> 3+3+3+1 centered */
    .an_homecategories-listview[data-cols-tablet="3"][data-count="10"] > :nth-child(10) { grid-column: 5 / span 4; }
    /* cols=4: N=5 -> 4+1 centered */
    .an_homecategories-listview[data-cols-tablet="4"][data-count="5"] > :nth-child(5) { grid-column: 5 / span 3; }
    /* cols=4: N=6 -> 4+2 centered */
    .an_homecategories-listview[data-cols-tablet="4"][data-count="6"] > :nth-child(5) { grid-column: 4 / span 3; }
    .an_homecategories-listview[data-cols-tablet="4"][data-count="6"] > :nth-child(6) { grid-column: 7 / span 3; }
    /* cols=4: N=7 -> 4+3 centered */
    .an_homecategories-listview[data-cols-tablet="4"][data-count="7"] > :nth-child(5) { grid-column: 2 / span 3; }
    .an_homecategories-listview[data-cols-tablet="4"][data-count="7"] > :nth-child(6) { grid-column: 5 / span 3; }
    .an_homecategories-listview[data-cols-tablet="4"][data-count="7"] > :nth-child(7) { grid-column: 8 / span 3; }
    /* cols=4: N=9 -> 4+4+1 centered */
    .an_homecategories-listview[data-cols-tablet="4"][data-count="9"] > :nth-child(9) { grid-column: 5 / span 3; }
    /* cols=4: N=10 -> 4+4+2 centered */
    .an_homecategories-listview[data-cols-tablet="4"][data-count="10"] > :nth-child(9) { grid-column: 4 / span 3; }
    .an_homecategories-listview[data-cols-tablet="4"][data-count="10"] > :nth-child(10) { grid-column: 7 / span 3; }
}

/* Desktop >=1200px - uses data-cols-desktop, 12-col grid */
@media (min-width: 1200px) {
    .an_homecategories-listview {
        grid-template-columns: repeat(12, 1fr);
        gap: 20px;
    }
    .an_homecategories-listview .an_homecategories-image {
        width: var(--an-hc-list-img-w-desktop, 220px);
    }
    .an_homecategories-listview .an_homecategories-item {
        max-width: var(--an-hc-list-item-max, none);
    }
    .an_homecategories-listview .an_homecategories-item-desc { padding: 18px 22px; }
    .an_homecategories-listview .an_homecategories-item-title { font-size: 15px; }

    .an_homecategories-listview[data-cols-desktop="auto"] {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
    .an_homecategories-listview[data-cols-desktop="auto"] > * { grid-column: auto; }
    .an_homecategories-listview[data-cols-desktop="1"] > * { grid-column: span 12; }
    .an_homecategories-listview[data-cols-desktop="1"] .an_homecategories-item { max-width: none; }
    .an_homecategories-listview[data-cols-desktop="2"] > * { grid-column: span 6; }
    .an_homecategories-listview[data-cols-desktop="3"] > * { grid-column: span 4; }
    .an_homecategories-listview[data-cols-desktop="4"] > * { grid-column: span 3; }

    .an_homecategories-listview[data-cols-desktop="2"][data-count="3"] > :nth-child(3),
    .an_homecategories-listview[data-cols-desktop="2"][data-count="5"] > :nth-child(5),
    .an_homecategories-listview[data-cols-desktop="2"][data-count="7"] > :nth-child(7),
    .an_homecategories-listview[data-cols-desktop="2"][data-count="9"] > :nth-child(9) {
        grid-column: 4 / span 6;
    }
    .an_homecategories-listview[data-cols-desktop="3"][data-count="4"] > * { grid-column: span 6; }
    .an_homecategories-listview[data-cols-desktop="3"][data-count="5"] > :nth-child(4) { grid-column: 3 / span 4; }
    .an_homecategories-listview[data-cols-desktop="3"][data-count="5"] > :nth-child(5) { grid-column: 7 / span 4; }
    .an_homecategories-listview[data-cols-desktop="3"][data-count="7"] > :nth-child(7) { grid-column: 5 / span 4; }
    .an_homecategories-listview[data-cols-desktop="3"][data-count="8"] > :nth-child(7) { grid-column: 3 / span 4; }
    .an_homecategories-listview[data-cols-desktop="3"][data-count="8"] > :nth-child(8) { grid-column: 7 / span 4; }
    .an_homecategories-listview[data-cols-desktop="3"][data-count="10"] > :nth-child(10) { grid-column: 5 / span 4; }
    .an_homecategories-listview[data-cols-desktop="4"][data-count="5"] > :nth-child(5) { grid-column: 5 / span 3; }
    .an_homecategories-listview[data-cols-desktop="4"][data-count="6"] > :nth-child(5) { grid-column: 4 / span 3; }
    .an_homecategories-listview[data-cols-desktop="4"][data-count="6"] > :nth-child(6) { grid-column: 7 / span 3; }
    .an_homecategories-listview[data-cols-desktop="4"][data-count="7"] > :nth-child(5) { grid-column: 2 / span 3; }
    .an_homecategories-listview[data-cols-desktop="4"][data-count="7"] > :nth-child(6) { grid-column: 5 / span 3; }
    .an_homecategories-listview[data-cols-desktop="4"][data-count="7"] > :nth-child(7) { grid-column: 8 / span 3; }
    .an_homecategories-listview[data-cols-desktop="4"][data-count="9"] > :nth-child(9) { grid-column: 5 / span 3; }
    .an_homecategories-listview[data-cols-desktop="4"][data-count="10"] > :nth-child(9) { grid-column: 4 / span 3; }
    .an_homecategories-listview[data-cols-desktop="4"][data-count="10"] > :nth-child(10) { grid-column: 7 / span 3; }
}