/* ============================================================
   EQ AUDIO VIDEO | Archive layout
   Scoped to WooCommerce archives; retains native The7 grid.
   ============================================================ */

body:is(.tax-product_cat, .post-type-archive-product, .tax-brand, .tax-product_brand,.eq-product-search) .page-title {
    background-color: #fff;
}

body:is(.tax-product_cat, .post-type-archive-product, .tax-brand, .tax-product_brand,.eq-product-search) #main > .wf-wrap {
    width: 100%;
    max-width: none;
    padding-inline: 30px;
    box-sizing: border-box;
}
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #content { min-width: 0; }
@media screen and (min-width: 1020px) {
    body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #main.sidebar-left .wf-container-main {
        grid-template-columns: 225px minmax(0, 1fr);
        column-gap: 30px;
    }
    body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #main.sidebar-divider-vertical.sidebar-left .sidebar .sidebar-content {
        margin-left: -10px;
    }
}
@media screen and (max-width: 767px) {
    body:is(.tax-product_cat, .post-type-archive-product, .tax-brand, .tax-product_brand,.eq-product-search) #main > .wf-wrap {
        padding-inline: 15px;
    }
}

/* Native description, relocated by archive-layout.js when a title exists. */
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #content .woocommerce-products-header .term-description,
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) .page-title .woo-archive-description {
    max-width: 550px;
    margin: 0 auto 24px;
    text-align: center;
}

/* Equal-width responsive columns; retain The7 gap settings. */
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #content .wc-grid.resize-by-browser-width .dt-css-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media screen and (max-width: 991px) {
    body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #content .wc-grid.resize-by-browser-width .dt-css-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media screen and (max-width: 767px) {
    body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #content .wc-grid.resize-by-browser-width .dt-css-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Sorting: base layout; desktop positioning below. */
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #content .switcher-wrap .woocommerce-result-count { display: none !important; }
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #content .switcher-wrap .woocommerce-ordering {
    margin-top: 0;
    margin-bottom: 0;
    margin-left: auto;
    z-index: 1;
}
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #content .switcher-wrap .woocommerce-ordering select { float: right; max-width: 100%; }
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #content .wc-grid.dt-products.products { margin-top: 0; }

/* Square image slots remain intact even when an image fails. */
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #content .wc-grid.dt-products .woo-buttons-on-img {
    aspect-ratio: 1 / 1;
    width: 100%;
    position: relative;
    overflow: hidden;
}
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #content .wc-grid.dt-products .woo-buttons-on-img > a.alignnone {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
}
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #content .wc-grid.dt-products .woo-buttons-on-img > a.alignnone > img:not(.back-image) {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 1 !important;
    visibility: visible !important;
}
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #content .wc-grid.dt-products .woo-buttons-on-img img.back-image { display: none !important; }

/* Product card typography. */
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #content .wc-grid.dt-products .woocom-list-content {
    text-align: left;
    align-items: flex-start;
}
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #content .wc-grid.dt-products .entry-title,
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #content .wc-grid.dt-products .entry-title a {
    text-align: left;
    text-transform: uppercase;
}
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #content .wc-grid.dt-products .woocom-list-content .price {
    margin-bottom: 15px;
}
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #content .wc-grid.dt-products .price > .amount,
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #content .wc-grid.dt-products .price > .amount > bdi {
    font-size: 22px !important;
}

/* Category widget: independent of widget instance ID. */
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #sidebar .widget_product_categories > ul > li.cat-parent > a {
    font: normal 16px / 28px "Lato", Helvetica, Arial, Verdana, sans-serif;
}
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #sidebar .widget_product_categories > ul > li.cat-item > ul > li.cat-item > a {
    font: normal 14.5px / 28px "Lato", Helvetica, Arial, Verdana, sans-serif;
}
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #sidebar .widget_product_categories > ul > li.cat-item > ul > li.cat-item > ul > li.cat-item > a {
    font: normal 13.25px / 28px "Lato", Helvetica, Arial, Verdana, sans-serif;
}
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #sidebar .widget_product_categories .current-cat-parent > a,
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #sidebar .widget_product_categories .current-cat > a { font-weight: 600; }

/* The7 title wrapper: natural height for short and long descriptions. */
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) .page-title:is(.eq21-has-description,:has(.eq-catalogue-description)) {
    background: #fff;
    min-height: 0;
    height: auto;
}
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) .page-title:is(.eq21-has-description,:has(.eq-catalogue-description)) > .wf-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: auto;
    min-height: 0;
    padding-block: 32px 24px;
    box-sizing: border-box;
}
.page-title:is(.eq21-has-description,:has(.eq-catalogue-description)) .page-title-head { margin: 0 0 22px; }
.page-title:is(.eq21-has-description,:has(.eq-catalogue-description)) .woo-archive-description { width: 100%; margin: 0 auto; }
.page-title:is(.eq21-has-description,:has(.eq-catalogue-description)) .woo-archive-description > :last-child { margin-bottom: 0; }
#content .woocommerce-products-header.eq21-empty { display: none; }
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #content .wc-grid .woocom-list-content { width: 100%; }
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #content .wc-grid .woo-buttons-on-img > a.alignnone > img.eq21-image-failed { visibility: hidden !important; }
body:is(.woocommerce.archive, .tax-brand, .tax-product_brand,.eq-product-search) #content .wc-grid .woo-buttons-on-img > a.alignnone > img.eq21-placeholder { object-fit: contain; }

/* Compact sorting row and consistent linked price typography. */
body:is(.woocommerce.archive,.tax-brand,.tax-product_brand,.eq-product-search) #content .switcher-wrap { margin: 0 0 2px; padding: 0; min-height: 0; }
body:is(.woocommerce.archive,.tax-brand,.tax-product_brand,.eq-product-search) #content .switcher-wrap .woocommerce-ordering { margin-top: 0; margin-bottom: 0; }
body:is(.woocommerce.archive,.tax-brand,.tax-product_brand,.eq-product-search) #content .wc-grid.dt-products .woocom-list-content .price { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; text-align: center; gap: 8px; margin-top: 8px; width: 100%; }
body:is(.woocommerce.archive,.tax-brand,.tax-product_brand,.eq-product-search) #content .wc-grid.dt-products .price :is(del,ins,.amount,bdi) { font-size: 22px !important; }
body:is(.woocommerce.archive,.tax-brand,.tax-product_brand,.eq-product-search) #content .wc-grid.dt-products .price ins { font-weight: 400; color: #000; text-decoration: none; }
body:is(.woocommerce.archive,.tax-brand,.tax-product_brand,.eq-product-search) #content .wc-grid.dt-products .price ins .amount { font-weight: inherit; }
body:is(.woocommerce.archive,.tax-brand,.tax-product_brand,.eq-product-search) #content .wc-grid.dt-products .price del { font-weight: 400; }
body:is(.woocommerce.archive,.tax-brand,.tax-product_brand,.eq-product-search) #content .eq-price-link { display: block; width: 100%; color: inherit; text-decoration: none; }

/* Keep the sorting control in the white image area on desktop. */
@media (min-width: 992px) {
 body:is(.woocommerce.archive,.tax-brand,.tax-product_brand,.eq-product-search) #content .switcher-wrap { position: relative; z-index: 2; height: 0; margin: 0; overflow: visible; }
 body:is(.woocommerce.archive,.tax-brand,.tax-product_brand,.eq-product-search) #content .switcher-wrap .woocommerce-ordering { position: absolute; right: 0; top: 12px; }
 body:is(.woocommerce.archive,.tax-brand,.tax-product_brand,.eq-product-search) #content .wc-grid.dt-products.products { margin-top: 12px; }
}
body:is(.woocommerce.archive,.tax-brand,.tax-product_brand,.eq-product-search) #content .wc-grid.dt-products .woocom-list-content .price { flex-direction: column; align-items: center; gap: 3px; color: #303030; font-weight: 400; }
body:is(.woocommerce.archive,.tax-brand,.tax-product_brand,.eq-product-search) #content .wc-grid.dt-products .price ins { order: -1; color: #000; font-weight: 400; }
body:is(.woocommerce.archive,.tax-brand,.tax-product_brand,.eq-product-search) #content .wc-grid.dt-products .price ins :is(.amount,bdi) { color: #000; font-weight: 400; }
body:is(.woocommerce.archive,.tax-brand,.tax-product_brand,.eq-product-search) #content .wc-grid.dt-products .price del { color: #555; opacity: 1; font-weight: 400; }
body:is(.woocommerce.archive,.tax-brand,.tax-product_brand,.eq-product-search) #content .wc-grid.dt-products .price del :is(.amount,bdi), body:is(.woocommerce.archive,.tax-brand,.tax-product_brand,.eq-product-search) #content .wc-grid.dt-products .price del { font-size: 18px !important; color: #555; }

/* Price ranges remain inline; only actual sale markup stacks vertically. */
body:is(.woocommerce.archive,.tax-brand,.tax-product_brand,.eq-product-search) #content .wc-grid.dt-products .woocom-list-content .price:not(:has(del,ins)) {
 display: block; white-space: nowrap; text-align: center;
}
body:is(.woocommerce.archive,.tax-brand,.tax-product_brand,.eq-product-search) #content .wc-grid.dt-products .price:not(:has(del,ins)) .amount { display: inline; white-space: nowrap; }
@media(max-width:767px) {
 body:is(.woocommerce.archive,.tax-brand,.tax-product_brand,.eq-product-search) #content .wc-grid.dt-products .price:not(:has(del,ins)):has(.amount ~ .amount) :is(.amount,bdi) { font-size: clamp(11px, 2.8vw, 18px) !important; }
}

/* Desktop sorting shares the top edge of the image slots. */
@media(min-width:992px) {
 body:is(.woocommerce.archive,.woocommerce-shop,.tax-brand,.tax-product_brand,.eq-product-search) #content .switcher-wrap { height:0!important; min-height:0!important; padding:0!important; margin:0!important; }
 body:is(.woocommerce.archive,.woocommerce-shop,.tax-brand,.tax-product_brand,.eq-product-search) #content .switcher-wrap .woocommerce-ordering { top: 12px; margin:0!important; }
 body:is(.woocommerce.archive,.woocommerce-shop,.tax-brand,.tax-product_brand,.eq-product-search) #content > .wc-grid.dt-products.products { margin-top:12px!important; padding-top:0!important; }
 body:is(.woocommerce.archive,.woocommerce-shop,.tax-brand,.tax-product_brand,.eq-product-search) #content .wc-grid.dt-products > .dt-css-grid { padding-top:0!important; margin-top:0!important; }
}

/* Search shares product cards, but not the catalogue sidebar or overlaid sorting. */
body.eq-product-search #sidebar { display:none !important; }
body.eq-product-search #main .wf-container-main { display:block; }
body.eq-product-search #content { width:100%; max-width:none; padding:0 0 35px; }
body.eq-product-search #content .wc-grid .dt-css-grid { grid-template-columns:repeat(5,minmax(0,1fr)) !important; }
@media(max-width:1279px) { body.eq-product-search #content .wc-grid .dt-css-grid { grid-template-columns:repeat(4,minmax(0,1fr)) !important; } }
@media(max-width:991px) { body.eq-product-search #content .wc-grid .dt-css-grid { grid-template-columns:repeat(3,minmax(0,1fr)) !important; } }
@media(max-width:767px) { body.eq-product-search #content .wc-grid .dt-css-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; } }
body.eq-product-search #content .switcher-wrap { display:flex; flex-wrap:wrap; align-items:center; height:auto!important; margin:0 0 16px!important; gap:12px; }
body.eq-product-search #content .switcher-wrap .woocommerce-ordering { position:static; margin-left:auto!important; }
body.eq-product-search #content .switcher-wrap .woocommerce-result-count { display:block!important; }
/* Search refinement occupies the archive description slot. */
body.eq-product-search .page-title .eq-search-description { max-width: 600px; }
body.eq-product-search .eq-search-refine { display: flex; align-items: stretch; gap: 8px; width: 100%; margin: 0; }
/* The submit button uses the shared WooCommerce .button style. Only layout is local. */
body.eq-product-search .eq-search-refine input[type=search] { box-sizing: border-box; flex: 1 1 0; width: 0; min-width: 0; height: auto; min-height: 0; margin: 0 !important; padding: 0 14px; font-size: 18px !important; line-height: 1.4; }
body.eq-product-search .eq-search-refine button.button { flex: 0 0 auto; align-self: center; margin: 0; }
body.eq-product-search .eq-search-refine :focus-visible { outline: 2px solid #555; outline-offset: 2px; }
body.eq-product-search #content .woocommerce-products-header:empty { display: none; }
body.eq-product-search #content .woocommerce-products-header .woocommerce-products-header__title { display: none; }
