/*
 * Product Categories Section
 * Path: assets/css/product-categories.css
 */

.db-categories {
    width: calc(100% - 40px);
    max-width: 1320px;
    margin: 88px auto 120px;
    direction: rtl;
    font-family: Vazirmatn, sans-serif;
}

.db-categories__header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 0 32px;
    text-align: center;
}

.db-categories__title {
    margin: 0;
    color: #000000;
    font-family: Vazirmatn, sans-serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.5;
}

.db-categories__subtitle {
    margin: 4px 0 0;
    color: #000000;
    font-family: Vazirmatn, sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.7;
}

.db-categories__grid {
    display: grid;
    grid-template-columns: repeat(7, 150px);
    column-gap: 45px;
    align-items: start;
    justify-content: start;
}

.db-categories__card {
    display: flex;
    width: 150px;
    flex-direction: column;
    align-items: center;
    color: #000000;
    text-align: center;
    text-decoration: none;
}

.db-categories__image {
    display: block;
    width: 150px;
    height: 150px;
    object-fit: cover;
    transition: filter 220ms ease;
}

.db-categories__card:hover .db-categories__image {
    filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.16));
}

.db-categories__card:focus-visible {
    border-radius: 8px;
    outline: 3px solid #ff8533;
    outline-offset: 5px;
}

.db-categories__name {
    display: block;
    margin-top: 6px;
    color: #000000;
    font-family: Vazirmatn, sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
}
@media (max-width: 768px) {

    .db-categories {
        width: 100%;
        max-width: none;
        margin: 56px 0 80px;
        overflow: hidden;
    }

    .db-categories__header {
        padding: 0 20px;
        margin-bottom: 24px;
        text-align: center;
    }

    .db-categories__title {
        font-size: 20px;
    }

    .db-categories__subtitle {
        font-size: 14px;
    }

    .db-categories__grid {
        display: flex;
        gap: 12px;
        justify-content: flex-start;
        overflow-x: auto;
        padding: 0 20px 16px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .db-categories__grid::-webkit-scrollbar {
        display: none;
    }

    .db-categories__card {
        flex: 0 0 calc((100vw - 88px) / 3);
        width: calc((100vw - 88px) / 3);
        scroll-snap-align: start;
    }

    .db-categories__image {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .db-categories__name {
        margin-top: 6px;
        font-size: 13px;
        line-height: 1.5;
        white-space: nowrap;
    }
}