/* Manufacturer pages (product/manufacturer_info.tpl and manufacturer_list.tpl; linked from the page templates only).
   Everything is under .bgMfPage / .bgMfListPage, nothing leaks to other pages. Palette of the site: cream #FFF6EA / #FBF4E7,
   line #E5CDB0 / #F1D3AE, brown #52362A, orange #FE8D0B, dark orange (text, accents) #B4520A, muted brown #7A5A4A. */

/* ---------- Page of one manufacturer ---------- */

/* the links to the categories of the brand: one compact row instead of the big plate of site-ui-fixes.css
   (!important there, so the same weight is needed here) */
.bgMfPage .bgMfCats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    max-width: none;
    margin: 6px 0 14px;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
}

.bgMfPage .bgMfCats strong {
    display: block;
    margin: 0;
    color: #7A5A4A;
    font: bold 12px/1.2 'robotoregular', Arial, sans-serif;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.bgMfPage .bgMfCats > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bgMfPage .bgMfCats a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 40px;
    padding: 0 18px !important;
    border: 1px solid #FFC583 !important;
    border-radius: 999px;
    background: #fff !important;
    color: #52362A !important;
    font: bold 14px/1.2 'robotoregular', Arial, sans-serif !important;
    text-decoration: none !important;
    transition: background-color .2s ease, border-color .2s ease;
}

.bgMfPage .bgMfCats a:hover {
    border-color: #FE8D0B !important;
    background: #FFF1DE !important;
    color: #52362A !important;
}

.bgMfPage .bgMfCats a:focus-visible {
    outline: 3px solid #B4520A;
    outline-offset: 2px;
}

/* sort switch: a thin row between the filter and the grid, to the right; not pinned */
.bgMfPage .bgMfSort {
    clear: both;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin: -8px 0 14px;
    color: #7A5A4A;
    font-family: 'robotoregular', Arial, sans-serif;
}

.bgMfPage .bgMfSortLabel {
    margin: 0;
    font: bold 12px/1.2 'robotoregular', Arial, sans-serif;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.bgMfPage .bgMfSortSelect {
    box-sizing: border-box;
    width: 250px;
    max-width: 100%;
    height: 40px;
    margin: 0;
    padding: 0 38px 0 14px;
    border: 1px solid #E5CDB0;
    border-radius: 12px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23B4520A' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    color: #311810;
    font: 15px/1.2 'robotoregular', Arial, sans-serif;
    text-overflow: ellipsis;
    cursor: pointer;
}

.bgMfPage .bgMfSortSelect:hover {
    border-color: #FE8D0B;
}

.bgMfPage .bgMfSortSelect:focus-visible {
    outline: 3px solid #B4520A;
    outline-offset: 2px;
}

/* the hovered card lifts itself with z-index 100 (main.css): under the pinned filter (25) it stays below it
   (listing-filter.css does this for .bgLF ~ .flexWrapperProductsAjax; the sort row between them does not break the rule) */
.bgMfPage .bgLF ~ .flexWrapperProductsAjax .productListCart:hover .productListCartIn {
    z-index: 24;
}

/* ---------- Empty states ---------- */

.bgMfEmpty {
    box-sizing: border-box;
    max-width: 520px;
    margin: 12px auto 40px;
    padding: 26px 22px 28px;
    border: 1px solid #F1E0CB;
    border-radius: 16px;
    background: #FFF6EA;
    color: #52362A;
    text-align: center;
}

.bgMfEmpty .bgMfEmptyIcon {
    display: block;
    margin: 0 auto 10px;
    fill: none;
    stroke: #B99A80;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bgMfEmpty .bgMfEmptyText {
    margin: 0 0 18px;
    font: 17px/1.4 'robotoregular', Arial, sans-serif;
    text-wrap: balance;
}

.bgMfEmpty .bgMfEmptyLink {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 24px;
    border-radius: 12px;
    background: #B4520A;
    color: #fff;
    font: bold 16px/1.2 'robotoregular', Arial, sans-serif;
    text-decoration: none;
    transition: background-color .2s ease;
}

.bgMfEmpty .bgMfEmptyLink:hover {
    background: #52362A;
}

.bgMfEmpty .bgMfEmptyLink:focus-visible {
    outline: 3px solid #B4520A;
    outline-offset: 3px;
}

/* ---------- List of manufacturers ---------- */

.bgMfListPage .bgMfGrid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin: 22px 0 40px;
    padding: 0;
    list-style: none;
}

.bgMfListPage .bgMfGrid > li {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* a tile like the subcategory tiles (bg-design.css): cream card, a mat with a double line, a brown name plate */
.bgMfListPage .bgMfCard {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    box-sizing: border-box;
    min-width: 0;
    padding: 12px 12px 0;
    border: 1px solid #F1D3AE;
    border-radius: 16px;
    background: #FBF4E7;
    box-shadow: 0 3px 12px rgba(82, 54, 42, .12);
    color: #FFC583;
    text-align: center;
    text-decoration: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.bgMfListPage .bgMfMark {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: 104px;
    margin-bottom: 14px;
    padding: 12px;
    border-radius: 3px;
    background: #FBF6EC radial-gradient(circle at center, #fff 0, #fff 33px, #C9A47A 33px, #C9A47A 34px, #FBF6EC 34px, #FBF6EC 37px, #C9A47A 37px, #C9A47A 38px, transparent 38px);
    box-shadow: inset 0 0 0 1px #C9A47A, inset 0 0 0 5px #FBF6EC, inset 0 0 0 6px #8A5A33, 0 1px 3px rgba(80, 50, 20, .15);
}

.bgMfListPage .bgMfMark {
    color: #8A5A33;
    font-family: 'bgLora', Georgia, 'Times New Roman', serif;
    font-size: 40px;
    font-weight: 700;
    line-height: 1;
}

.bgMfListPage .bgMfPlate {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    margin: 0 -12px;
    padding: 12px 14px 13px;
    border: 2px solid #FFC583;
    border-radius: 0 0 10px 10px;
    background: #52362A;
    box-shadow: 0 6px 18px rgba(82, 54, 42, .26);
    transition: background-color .2s ease, border-color .2s ease;
}

.bgMfListPage .bgMfName {
    display: block;
    color: #FFC583;
    font-family: 'Times New Roman', Times, serif;
    font-size: 19px;
    line-height: 1.25;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

.bgMfListPage .bgMfCount {
    display: block;
    margin-top: 4px;
    color: #F1D3AE;
    font: 13px/1.3 'robotoregular', Arial, sans-serif;
}

@media (hover: hover) {
    .bgMfListPage .bgMfCard:hover {
        border-color: #FE8D0B;
        box-shadow: 0 0 0 1px #FE8D0B, 0 8px 26px rgba(254, 141, 11, .38);
    }

    /* dark text on the orange plate: white on #FE8D0B is under 3:1 */
    .bgMfListPage .bgMfCard:hover .bgMfPlate {
        border-color: #FE8D0B;
        background: #FE8D0B;
    }

    .bgMfListPage .bgMfCard:hover .bgMfName,
    .bgMfListPage .bgMfCard:hover .bgMfCount {
        color: #311810;
    }
}

.bgMfListPage .bgMfCard:focus-visible {
    outline: 3px solid #B4520A;
    outline-offset: 3px;
    border-color: #FE8D0B;
}

.bgMfListPage .bgMfCard:focus-visible .bgMfPlate {
    border-color: #FE8D0B;
    background: #FE8D0B;
}

.bgMfListPage .bgMfCard:focus-visible .bgMfName,
.bgMfListPage .bgMfCard:focus-visible .bgMfCount {
    color: #311810;
}

/* ---------- Tablet and phone ---------- */

@media only screen and (max-width: 991px) {
    .bgMfListPage .bgMfGrid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }
}

@media only screen and (max-width: 767px) {
    .bgMfPage .bgMfCats {
        gap: 6px;
        margin: 4px 0 12px;
    }

    .bgMfPage .bgMfCats strong {
        flex: 1 0 100%;
    }

    .bgMfPage .bgMfCats > div {
        flex: 1 0 100%;
    }

    .bgMfPage .bgMfCats a {
        flex: 1 1 auto;
        min-height: 44px;
        padding: 0 14px !important;
    }

    .bgMfPage .bgMfSort {
        margin: -6px 0 12px;
    }

    .bgMfPage .bgMfSortLabel {
        flex: 0 0 auto;
    }

    .bgMfPage .bgMfSortSelect {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        max-width: 360px;
        height: 44px;
        font-size: 16px;
    }

    .bgMfEmpty {
        margin: 8px 0 28px;
    }

    .bgMfEmpty .bgMfEmptyLink {
        width: 100%;
        box-sizing: border-box;
    }

    .bgMfListPage .bgMfGrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        margin: 14px 0 28px;
    }

    .bgMfListPage .bgMfCard {
        padding: 8px 8px 0;
        border-radius: 14px;
    }

    .bgMfListPage .bgMfMark {
        height: 76px;
        margin-bottom: 10px;
        padding: 6px;
        background: #FBF6EC radial-gradient(circle at center, #fff 0, #fff 23px, #C9A47A 23px, #C9A47A 24px, #FBF6EC 24px, #FBF6EC 26px, #C9A47A 26px, #C9A47A 27px, transparent 27px);
        font-size: 26px;
    }

    .bgMfListPage .bgMfPlate {
        margin: 0 -8px;
        padding: 9px 10px 10px;
    }

    .bgMfListPage .bgMfName {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bgMfPage *,
    .bgMfListPage *,
    .bgMfEmpty * {
        transition: none !important;
    }
}
