/* ==================================================
   PNA Product Category Navigator
   ================================================== */

.pna-category-navigator {
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    font-family: inherit;
}


/* ==================================================
   Navigator Heading
   ================================================== */

.pna-category-navigator__heading {
    margin: 0 0 12px;
    padding: 0 0 12px;

    border-bottom: 1px solid #eeeeee;

    color: #222;
    font-size: 15px;
    font-weight: 600;
}


/* ==================================================
   Root Category
   ================================================== */

.pna-category-root {
    margin-bottom: 4px;
}

.pna-category-root > a {
    font-weight: 600;
}


/* ==================================================
   Category Lists
   ================================================== */

.pna-category-tree {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.pna-category-tree .pna-category-tree {
    padding-left: 18px !important;
}


/* ==================================================
   Category Items
   ================================================== */

.pna-category-item {
    position: relative;

    margin: 0 !important;
    padding: 0 !important;

    list-style: none !important;
}


/* Top-level categories always stay visible */

.pna-category-tree--top > .pna-category-item {
    display: block !important;
}


/* ==================================================
   Category Row
   ================================================== */

.pna-category-row {
    display: flex;
    align-items: center;

    width: 100%;
}


/* ==================================================
   Category Links
   ================================================== */

.pna-category-link {
    display: flex;
    flex: 1;
    align-items: center;

    min-width: 0;

    padding: 7px 0;

    color: #666;

    font-size: 13px;
    line-height: 1.4;

    text-decoration: none !important;

    transition: color .2s ease;
}

.pna-category-link:hover {
    color: #111;
}


/* Main categories slightly stronger */

.pna-category-tree--top >
.pna-category-item >
.pna-category-row >
.pna-category-link {
    color: #555;
}


/* ==================================================
   Category Toggle
   ================================================== */

.pna-category-toggle {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;

    padding: 0;

    border: 0;

    background: transparent;

    color: #111;

    font-family: inherit;
    font-size: 17px;
    font-weight: 500;

    line-height: 1;

    cursor: pointer;
}


/* ==================================================
   Active Category
   ================================================== */

.pna-category-item--active >
.pna-category-row >
.pna-category-link {
    color: #111;

    font-weight: 600;

    text-decoration: underline !important;
}

.pna-category-item--parent >
.pna-category-row >
.pna-category-link {
    color: #333;

    font-weight: 500;
}

.pna-category-root .pna-category--active {
    color: #111;

    font-weight: 600;

    text-decoration: underline !important;
}


/* Active main category */

.pna-category-tree--top >
.pna-category-item--active >
.pna-category-row >
.pna-category-link,

.pna-category-tree--top >
.pna-category-item--parent >
.pna-category-row >
.pna-category-link {
    color: #222;

    font-weight: 600;
}


/* ==================================================
   Collapse / Expand
   ================================================== */

.pna-category-item--has-children >
.pna-category-tree {
    display: none;
}

.pna-category-item--active >
.pna-category-tree,

.pna-category-item--parent >
.pna-category-tree,

.pna-category-item.pna-is-open >
.pna-category-tree {
    display: block;
}


/* ==================================================
   Availability / Stock Filter
   ================================================== */

.pna-stock-filter {
    margin-top: 22px;
    padding-top: 18px;

    border-top: 1px solid #eeeeee;
}

.pna-stock-filter__heading {
    margin-bottom: 13px;

    color: #222;

    font-size: 14px;
    font-weight: 600;
}


/* Stock option */

.pna-stock-filter__option {
    display: flex;
    align-items: center;
    gap: 9px;

    width: fit-content;

    margin: 0;

    cursor: pointer;

    user-select: none;
}


/* Hide native checkbox */

.pna-stock-filter__checkbox {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
    pointer-events: none;
}


/* Custom checkbox */

.pna-stock-filter__box {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 18px;
    height: 18px;

    flex: 0 0 18px;

    border: 1px solid #bdbdbd;
    border-radius: 2px;

    background: #fff;

    transition: all .2s ease;
}


/* Checked */

.pna-stock-filter__checkbox:checked +
.pna-stock-filter__box {
    background: #d71920;
    border-color: #d71920;
}


/* Tick */

.pna-stock-filter__checkbox:checked +
.pna-stock-filter__box::after {
    content: "";

    width: 8px;
    height: 4px;

    margin-top: -2px;

    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;

    transform: rotate(-45deg);
}


/* Stock text */

.pna-stock-filter__label {
    color: #555;

    font-size: 13px;
    line-height: 1.4;
}

.pna-stock-filter__option:hover
.pna-stock-filter__label {
    color: #111;
}


/* ==================================================
   AJAX Loading
   ================================================== */

ul.products {
    transition: opacity .18s ease;
}

ul.products.pna-products-loading {
    opacity: .35;

    pointer-events: none;
}


/* ==================================================
   MOTTA TOP CATEGORY NAVIGATION
   Exact classes from Motta markup
   ================================================== */

.catalog-top-categories {
    --pna-top-category-width: 118px;
    --pna-top-category-end-gap: 52px;
}

/*
 * Individual category tile.
 *
 * Original Motta markup:
 *
 * <a class="catalog-top-categories__item swiper-slide">
 */
.catalog-top-categories__item {
    width: var(--pna-top-category-width) !important;
    min-width: var(--pna-top-category-width) !important;
    max-width: var(--pna-top-category-width) !important;

    flex: 0 0 var(--pna-top-category-width) !important;

    padding-left: 10px !important;
    padding-right: 10px !important;

    box-sizing: border-box !important;

    overflow: visible !important;

    text-align: center !important;
}


/*
 * Category image.
 */
.catalog-top-categories__image {
    display: block !important;

    margin-left: auto !important;
    margin-right: auto !important;

    object-fit: contain !important;
}


/*
 * Category title.
 *
 * The important fix is removing Motta's:
 *
 * -webkit-line-clamp: 1;
 * overflow: hidden;
 *
 * which was forcing the title onto one line.
 */
.catalog-top-categories__text {
    display: block !important;

    width: 100% !important;
    max-width: var(--pna-top-category-width) !important;

    margin: 10px auto 0 !important;

    padding: 0 2px !important;

    color: #222 !important;

    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;

    text-align: center !important;

    white-space: normal !important;

    overflow: visible !important;
    text-overflow: clip !important;

    word-break: normal !important;
    overflow-wrap: anywhere !important;

    -webkit-line-clamp: unset !important;
    -webkit-box-orient: initial !important;

    min-height: 36px !important;
}


/*
 * Give the Swiper row breathing room.
 */
.catalog-top-categories .swiper-wrapper {
    /*
     * Do not use CSS gap here. Swiper calculates the total slide track
     * itself and a separate CSS gap is not included in that calculation,
     * which caused the final category to be cut off.
     */
    gap: 0 !important;

    align-items: flex-start !important;
}

/* Keep WooCommerce's empty-category notice inside the persistent
 * products container so another category can be selected immediately. */
ul.products > .pna-empty-products {
    list-style: none !important;
    width: 100% !important;
    grid-column: 1 / -1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

ul.products > .pna-empty-products > .woocommerce-info,
ul.products > .pna-empty-products > .woocommerce-message {
    width: 100% !important;
    margin: 0 !important;
}


/* ==================================================
   Desktop
   ================================================== */

@media (min-width: 1200px) {

    .catalog-top-categories {
        --pna-top-category-width: 118px;
        --pna-top-category-end-gap: 52px;
    }

    .catalog-top-categories__text {
        max-width: 135px !important;

        font-size: 13px !important;
    }
}


/* ==================================================
   Tablet
   ================================================== */

@media (max-width: 1199px) {

    .catalog-top-categories {
        --pna-top-category-width: 106px;
        --pna-top-category-end-gap: 28px;
    }

    .catalog-top-categories__text {
        max-width: 120px !important;

        font-size: 12px !important;
    }

}


/* ==================================================
   Mobile
   ================================================== */

@media (max-width: 767px) {

    .catalog-top-categories {
        --pna-top-category-width: 96px;
        --pna-top-category-end-gap: 20px;
    }

    .catalog-top-categories__item {
        padding-left: 3px !important;
        padding-right: 3px !important;
    }

    .catalog-top-categories__text {
        max-width: 94px !important;

        font-size: 11px !important;
        line-height: 1.25 !important;

        min-height: 32px !important;
    }

}

/* Representative product images in top categories */

.catalog-top-categories__image {
    width: 95px !important;
    height: 95px !important;

    object-fit: contain !important;
    object-position: center !important;

    background: transparent !important;
}

@media (max-width: 767px) {
    .catalog-top-categories__image {
        width: 86px !important;
        height: 86px !important;
    }
}

/* Native horizontal-scroll fallback used only when Motta has not attached a
 * Swiper instance. It keeps the last category reachable on mobile/AJAX views. */
.catalog-top-categories.pna-top-categories--native-scroll,
.catalog-top-categories.pna-top-categories--native-scroll .swiper,
.catalog-top-categories.pna-top-categories--native-scroll .swiper-container,
.catalog-top-categories.pna-top-categories--native-scroll .catalog-top-categories__items {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.catalog-top-categories.pna-top-categories--native-scroll::-webkit-scrollbar,
.catalog-top-categories.pna-top-categories--native-scroll .swiper::-webkit-scrollbar,
.catalog-top-categories.pna-top-categories--native-scroll .swiper-container::-webkit-scrollbar,
.catalog-top-categories.pna-top-categories--native-scroll .catalog-top-categories__items::-webkit-scrollbar {
    display: none;
}

.catalog-top-categories.pna-top-categories--native-scroll .swiper-wrapper {
    display: flex !important;
    flex-wrap: nowrap !important;
    width: max-content !important;
    min-width: 100% !important;
    padding-right: var(--pna-top-category-end-gap) !important;
    transform: none !important;
    box-sizing: border-box !important;
}

/* ==================================================
   Mobile - Hide WooCommerce Uncategorized everywhere
   ================================================== */
@media (max-width: 767px) {
    /* Motta mobile filter / category lists */
    .products-filter__option[data-value="uncategorized"],
    .catalog-sidebar .products-filter__option[data-value="uncategorized"],
    .offscreen-panel .products-filter__option[data-value="uncategorized"],
    .off-canvas-panel .products-filter__option[data-value="uncategorized"],
    .mobile-filter .products-filter__option[data-value="uncategorized"],

    /* WooCommerce category widgets / lists */
    li.cat-item-uncategorized,
    li.product_cat-uncategorized,
    li[class*="product_cat-uncategorized"],

    /* Motta/mobile items whose link points to Uncategorized */
    li:has(> a[href*="/product-category/uncategorized/"]),
    .products-filter__option:has(a[href*="/product-category/uncategorized/"]),
    .catalog-top-categories__item[href*="/product-category/uncategorized/"],
    a[href*="product_cat=uncategorized"] {
        display: none !important;
    }
}


/* =========================================================
   v1.1.10 - DEPARTMENT SECTION SCROLL / GRID STABILITY
   =========================================================
   Motta can rebuild the outer WooCommerce products grid while
   scrolling, lazy-loading or refreshing archive fragments. That
   rebuild can remove data-pna-sectioned-root from the outer UL.
   The department wrapper must remain a full-width grid/flex item
   even when that temporary marker is missing.
   ========================================================= */

html body ul.products > li.pna-department-sections,
body.woocommerce ul.products > li.pna-department-sections,
body.woocommerce-page ul.products > li.pna-department-sections,
body.tax-product_cat ul.products > li.pna-department-sections {
    display: block !important;
    position: relative !important;
    float: none !important;
    clear: both !important;
    flex: 0 0 100% !important;
    align-self: stretch !important;
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    transform: none !important;
    translate: none !important;
    box-sizing: border-box !important;
}

html body li.pna-department-sections > .pna-department-sections__inner,
html body li.pna-department-sections .pna-department-section,
html body li.pna-department-sections .pna-department-section__viewport {
    display: block !important;
    float: none !important;
    clear: both !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    transform: none !important;
    translate: none !important;
}

html body li.pna-department-sections
.pna-department-section__products.products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-auto-flow: row !important;
    gap: 16px !important;
    float: none !important;
    clear: both !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    transform: none !important;
    translate: none !important;
}

html body li.pna-department-sections
.pna-department-section__products.products > li.product {
    display: block !important;
    float: none !important;
    clear: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

html body li.pna-department-sections .pna-department-section__header,
html body li.pna-department-sections .pna-department-section__heading,
html body li.pna-department-sections .pna-department-section__header h2,
html body li.pna-department-sections .woocommerce-loop-product__title {
    min-width: 0 !important;
    max-width: 100% !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
}

@media (max-width: 1024px) {
    html body li.pna-department-sections
    .pna-department-section__products.products {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 14px !important;
    }
}

@media (max-width: 767px) {
    html body li.pna-department-sections
    .pna-department-section__products.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }
}


/* ==================================================
   PRODUCT SEARCH - PERSISTENT TOP CATEGORY NAVIGATION
   ================================================== */

.pna-search-top-categories {
    width: 100% !important;
    margin: 0 0 34px !important;
    padding: 0 0 22px !important;
    border-bottom: 1px solid #e8eaed !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}

.pna-search-top-categories__viewport {
    width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.pna-search-top-categories__viewport::-webkit-scrollbar {
    display: none;
}

.pna-search-top-categories .pna-search-top-categories__track {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    width: max-content !important;
    min-width: 100% !important;
    gap: 0 !important;
    padding: 0 16px 2px 0 !important;
    transform: none !important;
    box-sizing: border-box !important;
}

.pna-search-top-categories .catalog-top-categories__item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-decoration: none !important;
}

.pna-search-shop-all__circle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 95px !important;
    height: 95px !important;
    min-width: 95px !important;
    min-height: 95px !important;
    margin: 0 auto !important;
    border-radius: 50% !important;
    background: #1d2128 !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

.pna-search-top-categories .catalog-top-categories__image {
    border-radius: 50% !important;
}

@media (max-width: 767px) {
    .pna-search-top-categories {
        margin-bottom: 22px !important;
        padding-bottom: 14px !important;
    }

    .pna-search-top-categories .pna-search-top-categories__track {
        padding-right: 24px !important;
    }

    .pna-search-shop-all__circle {
        width: 78px !important;
        height: 78px !important;
        min-width: 78px !important;
        min-height: 78px !important;
        font-size: 12px !important;
    }

    .pna-search-top-categories .catalog-top-categories__image {
        width: 78px !important;
        height: 78px !important;
    }
}


/* ==============================================================
   PNA DEPARTMENT SECTIONS - v1.1.4
   Parent category pages show products grouped by direct subcategory.
   ============================================================== */

/* The section wrapper occupies the full WooCommerce product area. */
ul.products[data-pna-sectioned-root="1"] > .pna-department-sections,
ul.products.pna-sectioned-products-root > .pna-department-sections {
    display: block !important;
    list-style: none !important;
    width: 100% !important;
    max-width: 100% !important;
    grid-column: 1 / -1 !important;
    flex: 0 0 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide only the old flat main-query product cards on the initial archive.
   Nested subcategory cards remain visible because they are not direct children. */
body.pna-department-sectioned
ul.products[data-pna-sectioned-root="1"] > li.product {
    display: none !important;
}

/* v1.1.12: Motta can temporarily drop the data attribute while keeping the
   repaired root class, or leave the original flat cards after the section
   wrapper. Hide those outer fallback cards through both stable signals. */
body.pna-department-sectioned
ul.products.pna-sectioned-products-root > li.product,
html body.tax-product_cat
ul.products > li.pna-department-sections ~ li.product {
    display: none !important;
}

/* Motta infinite-scroll pages are catalogue continuations, not new category
   sections. Keep them invisible until the v1.1.11 DOM guard removes them. */
body.pna-department-sectioned
ul.products[data-pna-sectioned-continuation="1"] {
    display: none !important;
}

/* v1.1.13: this selector deliberately exceeds Motta's display:block rules.
   Each category preview is permanently limited to four direct cards. */
html body li.pna-department-sections
.pna-department-section__products.products
> li.product:nth-child(n+5),
html body li.pna-department-sections
.pna-department-section__products.products
> li.product[data-pna-four-card-overflow="1"] {
    display: none !important;
}

.pna-department-sections__inner {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.pna-department-section {
    width: 100% !important;
    margin: 0 0 30px !important;
    padding: 0 !important;
}

.pna-department-section:last-child {
    margin-bottom: 8px !important;
}

.pna-department-section__header {
    display: flex !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
    gap: 18px !important;
    width: 100% !important;
    margin: 0 0 14px !important;
}

.pna-department-section__heading {
    min-width: 0 !important;
}

.pna-department-section__eyebrow {
    display: block !important;
    margin: 0 0 4px !important;
    color: #d9272e !important;
    font-size: 10px !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    letter-spacing: .45px !important;
    text-transform: uppercase !important;
}

.pna-department-section__header h2 {
    margin: 0 !important;
    color: #20242a !important;
    font-size: 20px !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
}

.pna-department-section__view-all {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    flex: 0 0 auto !important;
    width: auto !important;
    margin: 0 !important;
    padding: 7px 2px !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #d9272e !important;
    font-size: 12px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
}

.pna-department-section__view-all:hover {
    color: #b91f25 !important;
    text-decoration: none !important;
}

.pna-department-section__viewport {
    width: 100% !important;
    overflow: hidden !important;
}

/* Reuse Motta/WooCommerce product cards, but lay them out as a clean preview row. */
.pna-department-section__products.products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 16px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.pna-department-section__products.products > li.product {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    float: none !important;
}

/* The outer archive count/pagination describes the hidden flat query, so hide
   those pieces on sectioned department pages. Sorting/filter controls remain. */
body.pna-department-sectioned .woocommerce-result-count,
body.pna-department-sectioned .woocommerce-pagination {
    display: none !important;
}

@media (max-width: 1024px) {
    .pna-department-section__products.products {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 14px !important;
    }
}

@media (max-width: 767px) {
    .pna-department-section {
        margin-bottom: 24px !important;
    }

    .pna-department-section__header {
        align-items: center !important;
        margin-bottom: 12px !important;
    }

    .pna-department-section__header h2 {
        font-size: 18px !important;
    }

    .pna-department-section__eyebrow {
        font-size: 9px !important;
    }

    .pna-department-section__view-all {
        font-size: 11px !important;
    }

    .pna-department-section__products.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }
}

/* =========================================================
   v1.1.5 - DEPARTMENT PRODUCT CARD PRICING / DEAL CONSISTENCY
   Matches the homepage language without replacing Motta's product template.
   ========================================================= */

.pna-department-section__products.products > li.product {
    position: relative !important;
}

/* Use our single DEAL badge in sectioned department rails. */
.pna-department-section__products.products > li.product .onsale {
    display: none !important;
}

.pna-department-product__deal-badge {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    z-index: 20 !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: auto !important;
    min-width: 0 !important;
    height: auto !important;

    margin: 0 !important;
    padding: 5px 8px !important;

    background: #16a34a !important;
    color: #fff !important;

    border: 0 !important;
    border-radius: 999px !important;
    box-shadow: none !important;

    font-size: 9px !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    letter-spacing: .2px !important;
    text-transform: uppercase !important;
}

.pna-department-section__products .price .pna-department-price {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px !important;

    margin: 0 !important;
}

.pna-department-price__row {
    display: inline-flex !important;
    align-items: baseline !important;
    gap: 5px !important;
}

.pna-department-price__label {
    display: inline-block !important;
    min-width: 25px !important;

    color: #7b8188 !important;
    font-size: 9px !important;
    line-height: 1.1 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
}

.pna-department-price__row--was del {
    color: #9ca3af !important;
    font-size: 11px !important;
    line-height: 1.15 !important;
    font-weight: 500 !important;
    opacity: 1 !important;
}

.pna-department-price__row--now .pna-department-price__label {
    color: #d9272e !important;
}

.pna-department-price__row--now ins {
    color: #171a1f !important;
    background: transparent !important;
    text-decoration: none !important;
    font-size: 18px !important;
    line-height: 1.1 !important;
    font-weight: 900 !important;
}

@media (max-width: 767px) {
    .pna-department-product__deal-badge {
        top: 8px !important;
        left: 8px !important;
        padding: 4px 7px !important;
        font-size: 8.5px !important;
    }

    .pna-department-price__row--now ins {
        font-size: 16px !important;
    }
}

/* =========================================================
   v1.1.6 - FIXED DEAL BADGE + DEPARTMENT QUANTITY PICKER
   ========================================================= */

/* Badge is now emitted as a direct child of the product card, so Motta's
   hover action panel cannot become its positioning context. */
.pna-department-section__products.products > li.product > .pna-department-product__deal-badge {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 60 !important;
    transform: none !important;
    translate: none !important;
    pointer-events: none !important;
}

.pna-department-section__products.products > li.product:hover > .pna-department-product__deal-badge,
.pna-department-section__products.products > li.product:focus-within > .pna-department-product__deal-badge {
    top: 10px !important;
    left: 10px !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    translate: none !important;
}

/* Quantity picker sits with the card actions and never floats over the image. */
.pna-department-qty {
    display: grid !important;
    grid-template-columns: 34px minmax(42px, 1fr) 34px !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 154px !important;
    height: 36px !important;
    margin: 10px 0 8px !important;
    padding: 0 !important;
    background: #fff !important;
    border: 1px solid #dfe3e7 !important;
    border-radius: 7px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

button.pna-department-qty__button {
    all: unset !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 36px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #f4f5f6 !important;
    color: #20242a !important;
    font-size: 17px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    user-select: none !important;
    box-sizing: border-box !important;
}

button.pna-department-qty__button:hover {
    background: #e8eaed !important;
    color: #d9272e !important;
}

.pna-department-qty__input {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 36px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: #20242a !important;
    font-size: 12px !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    text-align: center !important;
    -moz-appearance: textfield;
    box-sizing: border-box !important;
}

.pna-department-qty__input::-webkit-inner-spin-button,
.pna-department-qty__input::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

@media (max-width: 767px) {
    .pna-department-section__products.products > li.product > .pna-department-product__deal-badge,
    .pna-department-section__products.products > li.product:hover > .pna-department-product__deal-badge,
    .pna-department-section__products.products > li.product:focus-within > .pna-department-product__deal-badge {
        top: 8px !important;
        left: 8px !important;
    }

    .pna-department-qty {
        grid-template-columns: 32px minmax(38px, 1fr) 32px !important;
        max-width: 142px !important;
        height: 34px !important;
        margin-top: 8px !important;
    }

    button.pna-department-qty__button,
    .pna-department-qty__input {
        height: 34px !important;
    }

    button.pna-department-qty__button {
        width: 32px !important;
        font-size: 16px !important;
    }
}

/* =========================================================
   v1.1.7 - FOUR-CARD PREVIEW + SINGLE FIXED DEAL BADGE
   ========================================================= */

/* If Motta clones card internals for hover actions, never show a duplicate
   DEAL badge. The PHP renderer also suppresses duplicates per product. */
.pna-department-section__products.products > li.product > .pna-department-product__deal-badge ~ .pna-department-product__deal-badge {
    display: none !important;
}

/* Keep the one badge anchored to the card image area regardless of hover. */
.pna-department-section__products.products > li.product > .pna-department-product__deal-badge {
    top: 10px !important;
    left: 10px !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    translate: none !important;
    pointer-events: none !important;
}


/* =========================================================
   v1.1.8 - DEPARTMENT HOVER PANEL CONTAINMENT
   =========================================================
   Motta extends Add to cart / Quick View controls outside the
   normal product-card box on hover. The section viewport used
   to clip lower cards, while upper cards could overlap a second
   row. Keep previews to four cards and allow the hover controls
   enough room without covering another product row.
   ========================================================= */

/* Hard visual cap: even if an old/cached query temporarily returns more
   than four products, only the first four are shown in the department
   preview. "View All" remains the route to the full subcategory. */
.pna-department-section__products.products > li.product:nth-child(n+5) {
    display: none !important;
}

/* Motta's hover action panel is allowed to extend beyond the normal card
   box. The old overflow:hidden on the viewport was clipping the controls
   on cards near the bottom of a section. */
.pna-department-section__viewport {
    overflow: visible !important;
}

/* Keep the hovered card above its neighbours, but do not let it change
   the positioning of our DEAL badge. */
.pna-department-section__products.products > li.product {
    position: relative !important;
    z-index: 1 !important;
}

.pna-department-section__products.products > li.product:hover,
.pna-department-section__products.products > li.product:focus-within {
    z-index: 100 !important;
}

/* On desktop/tablet Motta's action tray can extend below the normal card.
   While a card is hovered, temporarily reserve vertical room so the tray
   does not sit on top of the following subcategory section. */
@media (min-width: 768px) {
    .pna-department-section:has(
        .pna-department-section__products.products > li.product:hover
    ),
    .pna-department-section:has(
        .pna-department-section__products.products > li.product:focus-within
    ) {
        margin-bottom: 150px !important;
    }
}

/* Re-assert one fixed DEAL badge on hover. */
.pna-department-section__products.products
> li.product
> .pna-department-product__deal-badge,
.pna-department-section__products.products
> li.product:hover
> .pna-department-product__deal-badge,
.pna-department-section__products.products
> li.product:focus-within
> .pna-department-product__deal-badge {
    top: 10px !important;
    left: 10px !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 120 !important;
    transform: none !important;
    translate: none !important;
    pointer-events: none !important;
}

@media (max-width: 767px) {
    .pna-department-section__products.products
    > li.product
    > .pna-department-product__deal-badge,
    .pna-department-section__products.products
    > li.product:hover
    > .pna-department-product__deal-badge,
    .pna-department-section__products.products
    > li.product:focus-within
    > .pna-department-product__deal-badge {
        top: 8px !important;
        left: 8px !important;
    }
}
