/**
 * Theoheat - Responsive Product Category Navigation
 *
 * Used by:
 * [theo_product_categories]
 *
 * Divi controls:
 * - Font family
 * - Font size
 * - Text colour
 * - Background
 * - Border
 * - Padding
 * - Margin
 * - Module width
 *
 * This file controls:
 * - Desktop list / mobile dropdown switching
 * - Category hierarchy
 * - Current category state
 * - Basic select layout
 */


/*======================================================================
# 1. VARIABLES
======================================================================*/

:root {
    --theo-primary: #5f5156;
    --theo-orange: #f3911e;
    --theo-orange-dark: #c04727;
    --theo-white: #ffffff;

    --theo-category-indent: 16px;
    --theo-category-radius: 6px;
}


/*======================================================================
# 2. BASE
======================================================================*/

.theo-product-category-nav {
    width: 100%;
    margin: 0;
    padding: 0;

    color: inherit;
    font: inherit;
}


/*======================================================================
# 3. DESKTOP CATEGORY LIST
======================================================================*/

.theo-product-category-desktop {
    display: block;
    width: 100%;
}


.theo-product-category-list {
    margin: 0;
    padding: 0;

    list-style: none;

    color: inherit;
    font: inherit;
}


.theo-product-category-list li {
    margin: 0;
    padding: 0;

    list-style: none;
}


/*--------------------------------------------------------------
# Category Links
--------------------------------------------------------------*/

.theo-product-category-list li > a {
    display: block;

    padding: 7px 10px;

    border-radius: var(--theo-category-radius);

    color: inherit;
    font: inherit;

    text-decoration: none;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        padding-left 0.2s ease;
}


/* Hover */
.theo-product-category-list li > a:hover,
.theo-product-category-list li > a:focus {
    padding-left: 14px;

    background: rgba(243, 145, 30, 0.10);

    color: var(--theo-orange-dark);

    text-decoration: none;
}


/*======================================================================
# 4. CURRENT CATEGORY
======================================================================*/

.theo-product-category-list .current-cat > a {
    background: var(--theo-orange);

    color: var(--theo-white);

    font-weight: 600;
}


/*
 * Parent / ancestor of current category.
 */
.theo-product-category-list .current-cat-parent > a,
.theo-product-category-list .current-cat-ancestor > a {
    color: var(--theo-orange-dark);

    font-weight: 600;
}


/*======================================================================
# 5. CHILD CATEGORIES
======================================================================*/

.theo-product-category-list ul {
    margin: 4px 0 5px var(--theo-category-indent);
    padding: 0 0 0 10px;

    border-left: 1px solid rgba(95, 81, 86, 0.15);

    list-style: none;
}


.theo-product-category-list ul li > a {
    font-size: 0.92em;
}


/*======================================================================
# 6. MOBILE CATEGORY DROPDOWN
======================================================================*/

.theo-product-category-mobile {
    display: none;
}


/*======================================================================
# 7. TABLET / MOBILE
======================================================================*/

@media (max-width: 980px) {

    /*
     * Hide desktop list.
     */
    .theo-product-category-desktop {
        display: none;
    }


    /*
     * Show compact dropdown.
     */
    .theo-product-category-mobile {
        display: block;

        width: 100%;

        margin: 0;
        padding: 0;
    }


    /*
     * Remove any extra navigation spacing.
     * Let the Divi Text module control the outer spacing.
     */
    .theo-product-category-nav {
        width: 100%;

        margin: 0;
        padding: 0;
    }


    /*----------------------------------------------------------
    # Select
    ----------------------------------------------------------*/

    .theo-product-category-select {
        display: block;

        width: 100%;
        max-width: 100%;
        min-height: 48px;

        box-sizing: border-box;

        margin: 0;
        padding: 9px 42px 9px 14px;

        border: 1px solid var(--theo-orange);
        border-radius: var(--theo-category-radius);

        background-color: var(--theo-white);

        color: inherit;
        font: inherit;

        cursor: pointer;

        transition:
            border-color 0.2s ease,
            box-shadow 0.2s ease;
    }


    /*
     * Keep browser dropdown options readable.
     */
    .theo-product-category-select option {
        color: var(--theo-primary);
        background: var(--theo-white);
    }


    /*
     * Focus state.
     */
    .theo-product-category-select:focus {
        border-color: var(--theo-orange-dark);

        outline: none;

        box-shadow:
            0 0 0 2px rgba(192, 71, 39, 0.12);
    }
}


/*======================================================================
# 8. SMALL MOBILE
======================================================================*/

@media (max-width: 479px) {

    .theo-product-category-select {
        min-height: 46px;

        padding-top: 8px;
        padding-bottom: 8px;
    }
}