/* Loja e categorias no mobile */
@media (max-width: 992px) {
    body:is(.woocommerce-shop, .tax-product_cat).m-search-bh .site-header .main-header.col-full {
        margin-bottom: 60px;
    }

    body:is(.woocommerce-shop, .tax-product_cat).m-search-bh .site-header .site-search input[type="search"] {
        font-size: 14px;
    }

    body:is(.woocommerce-shop, .tax-product_cat) #main .woocommerce-products-header__title {
        display: block;
        width: 100%;
        margin: 0;
        padding-block: 12px;
        text-align: left;
    }
}

/* Preços nos cards da loja e das categorias no mobile */
@media (max-width: 992px) {
    body:is(.woocommerce-shop, .tax-product_cat) #main .woocommerce-card__header > .woocommerce-loop-product__title {
        text-align: left;
    }

    body:is(.woocommerce-shop, .tax-product_cat) #main .zhf-apelos-preco--loop {
        align-items: flex-start;
    }

    body:is(.woocommerce-shop, .tax-product_cat) #main .woocommerce-card__header > .zhf-product-price-block--loop {
        margin: auto 0 5px;
        padding-top: 4px;
    }

    body:is(.woocommerce-shop, .tax-product_cat) #main .woocommerce-card__header > .zhf-product-price-block--loop ~ a.button {
        margin-top: 0;
    }

    body:is(.woocommerce-shop, .tax-product_cat) #main .zhf-product-price-block__head--loop {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(1em, auto) auto;
        align-items: start;
        row-gap: 2px;
    }

    body:is(.woocommerce-shop, .tax-product_cat) #main .zhf-product-price-block__head--loop:not(:has(> .zhf-product-stars--loop)) {
        grid-template-rows: 0 auto;
        row-gap: 0;
    }

    body:is(.woocommerce-shop, .tax-product_cat) #main .zhf-product-price-block__head--loop > .zhf-product-stars--loop {
        grid-row: 1;
        justify-self: start;
        margin-left: 0;
        align-items: flex-start;
        text-align: left;
    }

    body:is(.woocommerce-shop, .tax-product_cat) #main .zhf-product-price-block__head--loop > .zhf-product-price-block__main--loop {
        grid-row: 2;
        text-align: left;
    }

    body:is(.woocommerce-shop, .tax-product_cat) #main .zhf-product-price-block__main--loop:has(> del) {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        column-gap: 4px;
    }

    body:is(.woocommerce-shop, .tax-product_cat) #main .zhf-product-price-block__main--loop.price > del {
        margin-inline-end: 0;
    }

    body:is(.woocommerce-shop, .tax-product_cat) #main .zhf-product-price-block__main--loop bdi {
        white-space: nowrap;
    }

    body:is(.woocommerce-shop, .tax-product_cat) #main .zhf-apelos-preco--loop .payment-method {
        justify-content: flex-start;
        text-align: left;
    }

    body:is(.woocommerce-shop, .tax-product_cat) #main .zhf-apelos-preco--loop .payment-method--pix .zhf-pix-icon svg {
        width: 15px !important;
        margin-top: 0 !important;
    }

    body:is(.woocommerce-shop, .tax-product_cat) #main .zhf-apelos-preco--loop .payment-method--pix .payment-method__text > strong {
        margin-inline-end: 2px;
    }
}

/* Filtros e ordenação na mesma barra no mobile */
@media (max-width: 992px) {
    body:is(.woocommerce-shop, .tax-product_cat) #main:has(> .mobile-filter + .shoptimizer-sorting > .woocommerce-ordering) {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-flow: row dense;
    }

    body:is(.woocommerce-shop, .tax-product_cat) #main:has(> .mobile-filter + .shoptimizer-sorting > .woocommerce-ordering) > *,
    body:is(.woocommerce-shop, .tax-product_cat) #main > .mobile-filter + .shoptimizer-sorting > * {
        grid-column: 1 / -1;
        order: 0;
    }

    body:is(.woocommerce-shop, .tax-product_cat) #main > .mobile-filter + .shoptimizer-sorting:has(> .woocommerce-ordering) {
        display: contents;
    }

    body:is(.woocommerce-shop, .tax-product_cat) #main > .mobile-filter:has(+ .shoptimizer-sorting > .woocommerce-ordering) {
        grid-column: 1;
        align-self: start;
        width: auto;
        margin-block-end: 15px;
    }

    body:is(.woocommerce-shop, .tax-product_cat) #main > .mobile-filter + .shoptimizer-sorting > .woocommerce-ordering {
        grid-column: 2;
        align-self: start;
        position: sticky;
        z-index: 3;
        top: 0;
        width: auto;
        height: 40px;
        margin: 0 -1.3em 15px 0;
        background-color: #fff;
        border: 1px solid #e2e2e2;
        border-inline-end: 0;
        box-shadow: 0 4px 12px -2px rgb(0 0 0 / 6%);
        color: #111;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.03em;
    }

    body:is(.woocommerce-shop, .tax-product_cat).sticky-m #main > .mobile-filter + .shoptimizer-sorting > .woocommerce-ordering {
        top: 50px;
    }

    body:is(.woocommerce-shop, .tax-product_cat).sticky-m.m-search-toggled #main > .mobile-filter + .shoptimizer-sorting > .woocommerce-ordering {
        top: 110px;
    }

    /* O cabeçalho fixo ocupa 50px e a busca abaixo dele ocupa 45px. */
    body:is(.woocommerce-shop, .tax-product_cat).sticky-m.m-search-bh #main > .mobile-filter,
    body:is(.woocommerce-shop, .tax-product_cat).sticky-m.m-search-bh #main > .mobile-filter + .shoptimizer-sorting > .woocommerce-ordering {
        top: 95px;
    }

    body:is(.woocommerce-shop, .tax-product_cat) #main > .mobile-filter + .shoptimizer-sorting > .woocommerce-ordering .orderby {
        width: 100%;
        min-width: 0;
        height: 100%;
        margin: 0;
        padding: 0 28px 0 4px;
        background-color: transparent;
        background-position: right 10px center;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        color: inherit;
        font: inherit;
        letter-spacing: inherit;
        text-align: right;
        text-align-last: right;
        text-overflow: ellipsis;
        text-transform: uppercase;
    }

    body:is(.woocommerce-shop, .tax-product_cat) #main > .mobile-filter + .shoptimizer-sorting > .woocommerce-ordering .orderby:focus-visible {
        outline: 2px solid currentColor;
        outline-offset: -3px;
    }
}

/* Ordenação no topo e paginação no fim do catálogo */
body:is(.woocommerce-shop, .tax-product_cat) #main .shoptimizer-sorting:not(.sorting-end) > .woocommerce-pagination,
body:is(.woocommerce-shop, .tax-product_cat) #main .shoptimizer-sorting.sorting-end > .woocommerce-ordering {
    display: none;
}

body:is(.woocommerce-shop, .tax-product_cat) #main .shoptimizer-sorting.sorting-end:has(> .woocommerce-ordering:only-child) {
    display: none;
}

/* Preço original e promocional em colunas estreitas. */
@media (max-width: 359px) {
    body:is(.woocommerce-shop, .tax-product_cat).zhf-has-loop-price-block #main li.product .zhf-product-price-block__main--loop {
        font-size: 15px;
        column-gap: 3px;
    }

    body:is(.woocommerce-shop, .tax-product_cat) #main .zhf-product-price-block__main--loop ins .woocommerce-Price-currencySymbol {
        font-size: inherit;
        margin-inline-end: 1px;
    }
}

/* Seções recolhíveis do rodapé em telas pequenas. */
@media (max-width: 768px) {
    body:is(.woocommerce-shop, .tax-product_cat) #content.site-content {
        padding-block-end: 24px;
    }

    .site-footer > .col-full > .jussara-footer-source[hidden] {
        display: none;
    }

    .site-footer .jussara-mobile-footer {
        width: 100%;
        text-align: left;
    }

    .site-footer .jussara-footer-brand {
        display: inline-flex;
        margin: 0 0 16px;
    }

    .site-footer .jussara-footer-brand img {
        display: block;
        width: 180px;
        max-width: 100%;
        height: auto;
    }

    .site-footer .jussara-footer-section > summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 48px;
        padding: 12px 0;
        border-top: 1px solid #e5e5e5;
        color: inherit;
        cursor: pointer;
        font-size: 15px;
        font-weight: 600;
        line-height: 1.4;
        list-style: none;
    }

    .site-footer .jussara-footer-section:last-child {
        border-bottom: 1px solid #e5e5e5;
    }

    .site-footer .jussara-footer-section > summary::-webkit-details-marker {
        display: none;
    }

    .site-footer .jussara-footer-section > summary::after {
        flex: 0 0 8px;
        height: 8px;
        margin-right: 4px;
        border-right: 1px solid currentColor;
        border-bottom: 1px solid currentColor;
        transform: rotate(45deg);
        content: "";
    }

    .site-footer .jussara-footer-section[open] > summary::after {
        transform: rotate(225deg);
    }

    .site-footer .jussara-footer-section > summary:focus-visible {
        outline: 2px solid currentColor;
        outline-offset: -2px;
    }

    .site-footer .jussara-footer-section > :is(.textwidget, .payment-icons-new) {
        padding: 0 0 12px;
        overflow-wrap: anywhere;
        font-size: 14px;
        line-height: 1.5;
    }

    .site-footer .jussara-footer-section ul {
        margin: 0;
        list-style: none;
    }

    .site-footer .jussara-footer-section li {
        margin-bottom: 8px;
    }

    .site-footer .jussara-footer-section > .payment-icons-new {
        justify-content: flex-start;
    }

    .site-footer .jussara-footer-section .payment-icons {
        display: flex !important;
        flex-wrap: wrap;
        gap: 5px;
        margin: 0 !important;
    }

    .site-footer .jussara-footer-section .payment-icons .payment-icon {
        margin: 0;
    }

    .site-footer .jussara-footer-section .box-security {
        align-items: flex-start;
        gap: 8px;
        margin: 0;
    }

    .site-footer .jussara-footer-section .container-selos {
        width: min(100%, 340px);
        margin: 0;
    }

    .site-footer .jussara-footer-section .container-selos > div {
        flex: 1 1 0;
        min-width: 0;
        margin: 0;
    }

    .site-footer .jussara-footer-section .container-selos svg {
        max-width: 100%;
    }
}

/* Espaçamento das redes sociais e do crédito legal no rodapé móvel. */
@media (max-width: 768px) {
    .site-footer:has(.jussara-mobile-footer) + footer.copyright {
        margin-top: 0;
        padding-top: 4px;
        padding-bottom: 88px;
    }

    .site-footer:has(.jussara-mobile-footer) + footer.copyright .barra-icones .container {
        flex-wrap: wrap;
        gap: 8px;
        padding-bottom: 16px;
    }

    .site-footer:has(.jussara-mobile-footer) + footer.copyright .barra-icones .container > a {
        display: grid;
        width: 44px;
        height: 44px;
        place-items: center;
    }
}
