/* Product cards (every WooCommerce product loop: category pages, shop, home page, related
   products) and the shop filter bar dropdowns / checkboxes.
   Cards: a grid with shared hairlines; on hover the card lifts and shows its button and the
   wishlist heart (always shown on touch screens). Loaded after css/layout.css; !important where
   Betheme's WooCommerce styles are more specific. */

:root {
    --asitek-card-line: #e6e8eb;
    --asitek-card-accent: #258cd1;
    --asitek-card-accent-dark: #1b6fa8;
    --asitek-card-text: #1f1f1f;
    --asitek-card-muted: #6b7280;
}

/* ================================================================ grid */

.products_wrapper ul.products {
    --asitek-cols: 4;
    display: grid !important;
    grid-template-columns: repeat(var(--asitek-cols), minmax(0, 1fr));
    gap: 0 !important;
    margin: 0 0 30px !important;
    /* Lines are drawn by the cards (overlapping by 1px), so a row that is not full has no line
       running past its last card; the padding makes room for the overlap. */
    padding: 1px 0 0 1px !important;
    border: 0 !important;
}

.columns-2 .products_wrapper ul.products,
.products_wrapper ul.products.columns-2,
.products_wrapper ul.products.col-2 { --asitek-cols: 2; }

.columns-3 .products_wrapper ul.products,
.products_wrapper ul.products.columns-3,
.products_wrapper ul.products.col-3 { --asitek-cols: 3; }

.columns-5 .products_wrapper ul.products,
.products_wrapper ul.products.columns-5,
.products_wrapper ul.products.col-5 { --asitek-cols: 5; }

/* Clearfix pseudo-elements would take grid cells */
.products_wrapper ul.products::before,
.products_wrapper ul.products::after {
    display: none !important;
}

.products_wrapper ul.products > li.product {
    float: none !important;
    clear: none !important;
    width: auto !important;
    margin: -1px 0 0 -1px !important;
    border: 1px solid var(--asitek-card-line);
}

/* ================================================================ card */

ul.products li.product {
    position: relative;
    z-index: 0;
    display: flex !important;
    flex-direction: column;
    box-sizing: border-box;
    --asitek-card-pad-top: 16px;
    --asitek-card-pad-x: 18px;
    padding: var(--asitek-card-pad-top) var(--asitek-card-pad-x) 14px !important;
    background: #fff;
    text-align: left !important;
    transition: box-shadow .2s ease;
}

ul.products li.product:hover {
    z-index: 2;
    box-shadow: 0 0 0 1px var(--asitek-card-accent), 0 12px 32px rgba(16, 24, 40, .12);
}

/* Image. With the image flipper plugin (TP Product Image Flipper) the visible image is the
   plugin's copy at the top of .desc and the theme's own image row is empty: no gap for it. */
ul.products li.product .mfn-li-product-row-image {
    margin: 0 0 14px !important;
}

ul.products li.product:has(.tp-image-wrapper) .mfn-li-product-row-image {
    margin: 0 !important;
}

ul.products li.product .desc > a:has(> .tp-image-wrapper) {
    display: block;
    margin: 0 0 14px;
}

/* The flipper hides the theme's whole image box, and the wishlist heart is inside it: keep the
   box (zero height, its image hidden) so the heart can still show on hover. */
ul.products li.product:has(.tp-image-wrapper) .image_frame .image_wrapper {
    display: block !important;
    position: static !important;
    height: 0 !important;
    overflow: visible !important;
}

ul.products li.product:has(.tp-image-wrapper) .image_frame .image_wrapper > a {
    display: none !important;
}

/* Whole card clickable: the title link is stretched over the card (the button and the heart
   sit above it and keep their own clicks). */
ul.products li.product .desc,
ul.products li.product h4.mfn-woo-product-title,
ul.products li.product h4.mfn-woo-product-title a {
    position: static !important;
}

ul.products li.product h4.mfn-woo-product-title a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

ul.products li.product .onsale {
    z-index: 2;
}

ul.products li.product .image_frame {
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

ul.products li.product .image_frame .mask {
    display: none !important;
}

ul.products li.product .image_frame img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

/* Text column: title, price, then the button at the bottom (cards in a row line up) */
ul.products li.product .desc {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 0 !important;
    text-align: left !important;
}

ul.products li.product h4.mfn-woo-product-title {
    display: -webkit-box;
    min-height: 2.8em;
    margin: 0 0 8px !important;
    overflow: hidden;
    font-size: 15px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    text-align: left !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

ul.products li.product h4.mfn-woo-product-title a {
    color: var(--asitek-card-text) !important;
    text-decoration: none;
    transition: color .15s ease;
}

ul.products li.product:hover h4.mfn-woo-product-title a {
    color: var(--asitek-card-accent) !important;
}

ul.products li.product .price {
    display: block;
    margin: 0 !important;
    color: var(--asitek-card-text) !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    text-align: left !important;
}

ul.products li.product .price .woocommerce-Price-amount {
    color: inherit !important;
}

ul.products li.product .price .woocommerce-price-suffix {
    display: block;
    margin-top: 2px;
    color: var(--asitek-card-muted) !important;
    font-size: 13px !important;
    font-weight: 400 !important;
}

ul.products li.product .price .woocommerce-price-suffix .woocommerce-Price-amount {
    font-weight: 400 !important;
}

/* Card price (includes/product-card-price.php): price + small "ilma KM"; on sale the price is
   red with "Tavahind: …" under it. */
ul.products li.product .asitek-card-price {
    display: flex !important;
    flex-direction: column;
    gap: 3px;
}

ul.products li.product .asitek-card-price .asitek-price-now {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 6px;
}

ul.products li.product .asitek-card-price .asitek-price-now del {
    display: none; /* variable products on sale: the regular price range is not repeated */
}

ul.products li.product .asitek-card-price .asitek-price-now ins {
    background: none;
    text-decoration: none;
}

ul.products li.product .asitek-card-price .asitek-price-tax {
    color: var(--asitek-card-muted) !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1.2;
    white-space: nowrap;
}

ul.products li.product .asitek-card-price.is-on-sale .asitek-price-now,
ul.products li.product .asitek-card-price.is-on-sale .asitek-price-now .woocommerce-Price-amount {
    color: #d0312d !important;
}

ul.products li.product .asitek-card-price .asitek-price-was {
    color: var(--asitek-card-text) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.3;
}

ul.products li.product .asitek-card-price .asitek-price-was .woocommerce-Price-amount {
    color: inherit !important;
    font-weight: inherit !important;
}

/* Add to cart button ("Päringukorvi"), full width, blue.
   Phones / touch screens: under the price, always shown.
   Desktop with a mouse: takes the price's place on hover (covers the price, not the title), see
   the media query below. */
ul.products li.product .mfn-li-product-row-button {
    position: relative;
    z-index: 3;
    display: flex !important;
    gap: 8px;
    margin: 12px 0 0 !important;
}

/* "Vaata" duplicates the card link */
ul.products li.product .mfn-li-product-row-button .button.addtocartbutton {
    display: none !important;
}

ul.products li.product .mfn-li-product-row-button .button {
    flex: 1 1 auto;
    margin: 0 !important;
    padding: 11px 16px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: var(--asitek-card-accent) !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    text-align: center;
    transition: background-color .15s ease;
}

ul.products li.product .mfn-li-product-row-button .button:hover {
    background: var(--asitek-card-accent-dark) !important;
}

/* While adding (WooCommerce's .loading fades the button out): keep it solid, in the hover colour */
ul.products li.product .mfn-li-product-row-button .button.loading {
    opacity: 1 !important;
    background: var(--asitek-card-accent-dark) !important;
    cursor: progress;
}

@media (hover: hover) and (min-width: 768px) {
    /* The button takes the price's cell of the card grid (row 3) and fills it: on hover it covers
       exactly the price (one line, or with "Tavahind"), never the title. A price shorter than the
       button makes that row a little taller. */
    ul.products li.product {
        padding-bottom: 18px !important;
    }

    ul.products li.product .mfn-li-product-row-button,
    .products_wrapper ul.products > li.product .mfn-li-product-row-button {
        position: relative !important;
        grid-row: 3 !important;
        grid-column: 1;
        align-self: stretch !important;
        align-items: stretch !important;
        min-height: 38px;
        margin: 0 !important;
        opacity: 0;
        transform: translateY(6px);
        pointer-events: none;
        transition: opacity .2s ease, transform .2s ease;
    }

    /* :has(:focus-visible), not :focus-within: after a mouse click the clicked element keeps
       focus, which would keep the button shown after the mouse leaves. */
    ul.products li.product:hover .mfn-li-product-row-button,
    ul.products li.product:has(:focus-visible) .mfn-li-product-row-button {
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }

    ul.products li.product .mfn-li-product-row-button .button {
        display: flex !important;
        align-items: center;
        justify-content: center;
        align-self: stretch !important;
        height: auto !important;
        min-height: 38px;
        padding: 0 16px !important;
        box-shadow: 0 6px 16px rgba(16, 24, 40, .18);
    }
}

/* Hover icons on the image: only the wishlist heart, top right */
ul.products li.product .image_links {
    position: absolute !important;
    top: calc(10px - var(--asitek-card-pad-top)) !important; /* 10px from the card edges */
    right: calc(10px - var(--asitek-card-pad-x)) !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 3;
    display: flex !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    opacity: 0 !important;
    transform: scale(.85) !important;
    transition: opacity .2s ease, transform .2s ease !important;
}

ul.products li.product:hover .image_links,
ul.products li.product:has(:focus-visible) .image_links,
ul.products li.product:has(.mfn-wish-button.loved) .image_links {
    opacity: 1 !important;
    transform: none !important;
}

ul.products li.product .image_links > a:not(.mfn-wish-button) {
    display: none !important;
}

ul.products li.product .image_links > a.mfn-wish-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 38px !important;
    height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid var(--asitek-card-line) !important;
    border-radius: 50% !important;
    background: #fff !important;
    box-shadow: 0 2px 8px rgba(16, 24, 40, .08);
    /* Betheme fades / slides each icon in on hovering the theme's image box (0px tall with the
       image flipper), replaying its slide-in on every hover, which made an already shown (liked)
       heart jump. The .image_links wrapper does the showing instead. Its "pop" when liking
       (on the svg) stays. */
    opacity: 1 !important;
    visibility: visible !important;
    animation: none !important;
    transition: border-color .15s ease, transform .15s ease;
}

ul.products li.product .image_links > a.mfn-wish-button:hover {
    border-color: var(--asitek-card-accent) !important;
    transform: scale(1.06);
}

ul.products li.product .image_links > a.mfn-wish-button svg {
    width: 22px;
    height: 22px;
}

/* No "Salvesta toode" tooltip (Betheme's .tooltip :before / :after) on the card heart */
ul.products li.product .image_links > a.mfn-wish-button.tooltip::before,
ul.products li.product .image_links > a.mfn-wish-button.tooltip::after {
    display: none !important;
    content: none !important;
}

ul.products li.product .image_links > a.mfn-wish-button:hover svg .path {
    stroke: var(--asitek-card-accent) !important;
}

/* Liked: filled heart, shown without hovering too */
ul.products li.product .image_links > a.mfn-wish-button.loved svg .path {
    fill: var(--asitek-card-accent) !important;
    stroke: var(--asitek-card-accent) !important;
}

/* Touch screens: no hover, so the button and the heart are always there */
@media (hover: none) {
    ul.products li.product .image_links {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ================================================================ responsive */

@media (max-width: 1239px) {
    .products_wrapper ul.products,
    .columns-4 .products_wrapper ul.products,
    .columns-5 .products_wrapper ul.products,
    .products_wrapper ul.products.col-4,
    .products_wrapper ul.products.col-5 {
        --asitek-cols: 3;
    }
}

@media (max-width: 767px) {
    .products_wrapper ul.products,
    .columns-3 .products_wrapper ul.products,
    .columns-4 .products_wrapper ul.products,
    .columns-5 .products_wrapper ul.products,
    .products_wrapper ul.products.col-3,
    .products_wrapper ul.products.col-4,
    .products_wrapper ul.products.col-5 {
        --asitek-cols: 2;
    }

    ul.products li.product {
        --asitek-card-pad-top: 12px;
        --asitek-card-pad-x: 12px;
    }

    ul.products li.product h4.mfn-woo-product-title {
        font-size: 14px !important;
    }

    ul.products li.product .price {
        font-size: 16px !important;
    }


    /* css/layout.css gives every card min-width: 350px on phones (for the related products
       row); in the grid that would overflow the screen. */
    .products_wrapper ul.products > li.product {
        min-width: 0 !important;
    }

    /* Related products on the product page stay a sideways-scrolling row (css/layout.css) */
    .related.products ul.products {
        display: flex !important;
    }

    .related.products ul.products > li.product {
        min-width: 260px !important;
    }
}

/* ================================================================ shop filter bar */
/* Dropdowns (Bränd, sorting) and the Laos / Tellimisel checkboxes (css/layout.css has the
   layout; these are the finishing touches). */

/* The empty notices box took a full-width line of its own above the filters */
.shop-filters .woocommerce-notices-wrapper:empty {
    display: none !important;
}

.shop-filters {
    column-gap: 12px !important; /* css/layout.css: 24px */
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

.shop-filters .woocommerce-ordering select,
.shop-filters .asitek-brand-filter-toggle {
    min-height: 42px;
    border: 1px solid #d7dce2 !important;
    border-radius: 8px !important;
    background-color: #fff !important;
    color: var(--asitek-card-text) !important;
    font-size: 14px !important;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.shop-filters .woocommerce-ordering select:hover,
.shop-filters .asitek-brand-filter-toggle:hover {
    border-color: #b8c1cc !important;
}

.shop-filters .woocommerce-ordering select:focus,
.shop-filters .asitek-brand-filter-toggle:focus-visible,
.shop-filters .asitek-brand-filter.is-open .asitek-brand-filter-toggle {
    border-color: var(--asitek-card-accent) !important;
    box-shadow: 0 0 0 3px rgba(37, 140, 209, .15) !important;
    outline: none;
}

/* Chevron: the menu chevron in the text colour (images/mega-menu/chevron-text.svg), flips when open */
.shop-filters .woocommerce-ordering::after,
.asitek-brand-filter-toggle-icon {
    width: 12px !important;
    height: 12px !important;
    margin-top: -6px !important;
    border: 0 !important;
    background: url("../../images/mega-menu/chevron-text.svg?v=1") center / 12px 12px no-repeat;
    transform: rotate(-45deg) scaleY(-1) !important;
    transition: transform .25s ease !important;
}

.asitek-brand-filter-toggle-icon {
    top: 50% !important;
}

.asitek-brand-filter.is-open .asitek-brand-filter-toggle-icon {
    transform: rotate(135deg) scaleY(-1) !important;
}

.asitek-brand-filter-panel {
    top: calc(100% + 6px) !important;
    padding: 6px !important;
    border: 1px solid #e3e7ec !important;
    border-radius: 10px !important;
    box-shadow: 0 12px 32px rgba(16, 24, 40, .12) !important;
}

.asitek-brand-filter-option {
    padding: 8px 10px !important;
    border-radius: 6px;
    font-size: 14px !important;
    transition: background-color .12s ease;
}

.asitek-brand-filter-option:hover {
    background: #f2f7fb !important;
}

/* Checkboxes: rounded square, filled blue with a white tick when checked */
.asitek-stock-filter input[type="checkbox"],
.asitek-brand-filter-option input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    border: 1.5px solid #c3cad3 !important;
    border-radius: 5px !important;
    transition: background-color .15s ease, border-color .15s ease;
}

.asitek-stock-filter input[type="checkbox"]:hover,
.asitek-brand-filter-option input[type="checkbox"]:hover {
    border-color: var(--asitek-card-accent) !important;
}

.asitek-stock-filter input[type="checkbox"]:checked,
.asitek-brand-filter-option input[type="checkbox"]:checked {
    border-color: var(--asitek-card-accent) !important;
    background: var(--asitek-card-accent) !important;
}

.asitek-stock-filter input[type="checkbox"]::after,
.asitek-brand-filter-option input[type="checkbox"]::after {
    width: 5px !important;
    height: 9px !important;
    margin-top: -2px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    border-radius: 0 !important;
    background: none !important;
    transform: rotate(45deg) scale(0) !important;
}

.asitek-stock-filter input[type="checkbox"]:checked::after,
.asitek-brand-filter-option input[type="checkbox"]:checked::after {
    transform: rotate(45deg) scale(1) !important;
}

.asitek-stock-filter span {
    font-size: 14px;
}

/* ---------------------------------------------------------------- sorting dropdown */
/* js/shop-ui/sort-dropdown.js shows the "Vaikimisi järjestus" <select> as a dropdown like the
   "Bränd" filter (plain rows, the chosen one blue). The <select> stays in the form, hidden. */

.shop-filters .woocommerce-ordering.is-enhanced::after {
    display: none !important;
}

.shop-filters .woocommerce-ordering.is-enhanced select.orderby {
    position: absolute !important;
    width: 1px !important;
    min-width: 0 !important;
    height: 1px !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0;
    pointer-events: none;
}

.asitek-sort-dropdown {
    position: relative;
}

/* Betheme styles every <button> as a filled button: reset it */
.shop-filters .asitek-sort-dropdown button.asitek-sort-toggle,
.shop-filters .asitek-sort-dropdown button.asitek-sort-toggle:hover,
.shop-filters .asitek-sort-dropdown button.asitek-sort-toggle:focus,
.shop-filters .asitek-sort-dropdown button.asitek-sort-toggle:active {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: var(--asitek-sort-w, 200px); /* same as the Bränd dropdown; full width on phones */
    min-width: 0;
    height: auto;
    min-height: 42px;
    margin: 0 !important;
    padding: 8px 12px !important;
    border: 1px solid #d7dce2 !important;
    border-radius: 8px !important;
    background: #fff !important;
    box-shadow: none !important;
    color: var(--asitek-card-text) !important;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    letter-spacing: 0 !important;
    text-align: left;
    text-transform: none !important;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.shop-filters .asitek-sort-dropdown button.asitek-sort-toggle:hover {
    border-color: #b8c1cc !important;
}

.shop-filters .asitek-sort-dropdown button.asitek-sort-toggle:focus-visible,
.shop-filters .asitek-sort-dropdown.is-open button.asitek-sort-toggle {
    border-color: var(--asitek-card-accent) !important;
    box-shadow: 0 0 0 3px rgba(37, 140, 209, .15) !important;
    outline: none;
}

.asitek-sort-dropdown .asitek-sort-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asitek-sort-dropdown .asitek-sort-icon {
    flex: 0 0 12px;
    width: 12px;
    height: 12px;
    background: url("../../images/mega-menu/chevron-text.svg?v=1") center / 12px 12px no-repeat;
    transform: rotate(-45deg) scaleY(-1);
    transition: transform .25s ease;
}

.asitek-sort-dropdown.is-open .asitek-sort-icon {
    transform: rotate(135deg) scaleY(-1);
}

.asitek-sort-dropdown .asitek-sort-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1000;
    width: max-content;
    min-width: 100%;
    max-width: 340px;
    margin: 0;
    padding: 6px;
    border: 1px solid #e3e7ec;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(16, 24, 40, .12);
    list-style: none;
}

.asitek-sort-dropdown .asitek-sort-panel[hidden] {
    display: none;
}

.asitek-sort-dropdown .asitek-sort-option {
    margin: 0;
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--asitek-card-text);
    font-size: 14px;
    line-height: 1.4;
    list-style: none;
    white-space: nowrap;
    cursor: pointer;
    outline: none;
    transition: background-color .12s ease, color .12s ease;
}

.asitek-sort-dropdown .asitek-sort-option:hover,
.asitek-sort-dropdown .asitek-sort-option:focus {
    background: #f2f7fb;
}

.asitek-sort-dropdown .asitek-sort-option.is-selected {
    color: var(--asitek-card-accent);
    font-weight: 600;
}

@media (max-width: 768px) {
    /* A variable, not a width rule: the toggle's :hover / :focus styles above are more specific
       and would snap it back to 200px on hover. */
    .shop-filters .asitek-sort-dropdown {
        --asitek-sort-w: 100%;
    }

    .asitek-sort-dropdown .asitek-sort-panel {
        left: 0;
        width: auto;
        max-width: none;
    }

    .asitek-sort-dropdown .asitek-sort-option {
        white-space: normal;
    }
}

/* ---------------------------------------------------------------- wishlist "pop" */
/* Betheme's add-to-wishlist animation scales the heart 1 → .5 → 1.2 → 1; gentler: dips to .9. */
@keyframes asitek-wish-pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(.9); }
    100% { transform: scale(1); }
}

.mfn-wish-button.loved svg {
    animation-name: asitek-wish-pop !important;
    animation-duration: .35s !important;
    animation-timing-function: ease-out !important;
}

/* ================================================================ rows size to their own content */
/* Each card spans 4 rows of the product grid and shares them (subgrid): image, title, price,
   button (phones; on desktop the button is positioned and the row stays empty). So the title row is as tall as the longest title in that row of cards: one-line rows
   get no empty second line, and prices still line up across the row. (.desc's children join
   the card's grid via display: contents.) */

.products_wrapper ul.products {
    grid-auto-rows: auto;
}

.products_wrapper ul.products > li.product {
    display: grid !important;
    grid-row: span 4;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: subgrid;
    row-gap: 0;
    align-content: start;
}

.products_wrapper ul.products > li.product .desc {
    display: contents;
}

.products_wrapper ul.products > li.product .mfn-li-product-row-image,
.products_wrapper ul.products > li.product .desc > a:has(> .tp-image-wrapper) {
    grid-row: 1;
    grid-column: 1;
}

.products_wrapper ul.products > li.product h4.mfn-woo-product-title {
    grid-row: 2;
    grid-column: 1;
    min-height: 0;
}

/* Column given explicitly: on desktop the button shares this cell (an auto-placed price would be
   pushed into a new column) */
.products_wrapper ul.products > li.product .price {
    grid-row: 3;
    grid-column: 1;
    align-self: start;
}

.products_wrapper ul.products > li.product .mfn-li-product-row-button {
    grid-row: 4;
    align-self: end;
}

/* ---------------------------------------------------------------- sale badge ("-12%") */
/* Mirrors the wishlist heart: a 38px circle 10px from the card's top left corner (the heart is
   top right), always shown. */
ul.products li.product .image_frame .onsale,
ul.products li.product .onsale {
    position: absolute !important;
    top: calc(10px - var(--asitek-card-pad-top)) !important; /* 10px from the card edges */
    right: auto !important;
    bottom: auto !important;
    left: calc(10px - var(--asitek-card-pad-x)) !important;
    z-index: 3;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 38px !important;
    min-width: 0 !important;
    height: 38px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: #d0312d !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    letter-spacing: -.02em;
    text-align: center;
    transform: none !important;
}

/* ---------------------------------------------------------------- single product page */
/* "Seotud tooted" / upsells: no divider line above (Betheme's border-top), same spacing */
.woocommerce .product .related.products,
.woocommerce .product .upsells.products {
    border-top-width: 0 !important;
}

/* ---------------------------------------------------------------- category / shop page title */
body.tax-product_cat h1.page-title,
body.post-type-archive-product h1.page-title {
    color: #000 !important;
    font-weight: 600 !important;
}

/* Phones: the theme shrinks the page title to 14px (desktop 24px) */
@media (max-width: 767px) {
    body.tax-product_cat h1.page-title,
    body.post-type-archive-product h1.page-title {
        font-size: 24px !important;
        line-height: 1.25 !important;
    }
}

/* ---------------------------------------------------------------- shop sidebar categories */
/* Nothing to list (e.g. a category without subcategories, includes/shop-category-sidebar.php):
   no empty widget with only its title */
.widget_product_categories:not(:has(ul.product-categories li)) {
    display: none;
}

/* Shop sidebar 50px narrower (Betheme: 30% / 70%), the products get the space. Only where the
   sidebar is actually there (product pages have the with_aside class but no sidebar, and their
   content must stay full width). Desktop only: on phones the sidebar is the slide-out panel. */
@media (min-width: 960px) {
    body.woocommerce.with_aside #Content .content_wrapper:has(> .mcb-sidebar) > .mcb-sidebar {
        width: calc(30% - 50px) !important;
    }

    body.woocommerce.with_aside #Content .content_wrapper:has(> .mcb-sidebar) > .sections_group {
        width: calc(70% + 50px) !important;
    }
}

/* No ESTO instalment line on product cards (includes/product-card-price.php turns it off; this
   covers any other way it gets printed) */
ul.products li.product .esto-calculator-loop {
    display: none !important;
}

/* ---------------------------------------------------------------- wishlist heart, Betheme 29+ */
/* Newer Betheme (live) prints the heart as span.mfn-wish-button.mfn-abs-top directly in
   .image_frame instead of inside .image_links: the same look, place and behaviour as above. */
ul.products li.product .image_frame > .mfn-wish-button {
    position: absolute !important;
    top: calc(10px - var(--asitek-card-pad-top)) !important;
    right: calc(10px - var(--asitek-card-pad-x)) !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 3;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 38px !important;
    height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid var(--asitek-card-line) !important;
    border-radius: 50% !important;
    background: #fff !important;
    box-shadow: 0 2px 8px rgba(16, 24, 40, .08);
    opacity: 0 !important;
    visibility: visible !important;
    transform: scale(.85) !important;
    animation: none !important;
    cursor: pointer;
    transition: opacity .2s ease, transform .2s ease, border-color .15s ease !important;
}

ul.products li.product:hover .image_frame > .mfn-wish-button,
ul.products li.product:has(:focus-visible) .image_frame > .mfn-wish-button,
ul.products li.product .image_frame > .mfn-wish-button.loved {
    opacity: 1 !important;
    transform: none !important;
}

ul.products li.product .image_frame > .mfn-wish-button:hover {
    border-color: var(--asitek-card-accent) !important;
    transform: scale(1.06) !important;
}

ul.products li.product .image_frame > .mfn-wish-button svg {
    width: 22px;
    height: 22px;
    animation: none;
}

ul.products li.product .image_frame > .mfn-wish-button:hover svg .path {
    stroke: var(--asitek-card-accent) !important;
}

ul.products li.product .image_frame > .mfn-wish-button.loved svg .path {
    fill: var(--asitek-card-accent) !important;
    stroke: var(--asitek-card-accent) !important;
}

/* the gentle "pop" when liking (see wishlist "pop" above) */
ul.products li.product .image_frame > .mfn-wish-button.loved svg {
    animation-name: asitek-wish-pop !important;
    animation-duration: .35s !important;
    animation-timing-function: ease-out !important;
}

@media (hover: none) {
    ul.products li.product .image_frame > .mfn-wish-button {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ---------------------------------------------------------------- single product: heart + sale badge */
/* The same 38px circles as on the product cards, 15px from the gallery's top corners: the sale
   badge top left, the heart top right (always shown). With several images the slider moves the
   heart into its .flex-viewport, so not only direct children of the gallery. */
.single-product div.product .woocommerce-product-gallery .mfn-wish-button {
    box-sizing: border-box;
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 5;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 38px !important;
    height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid var(--asitek-card-line) !important;
    border-radius: 50% !important;
    background: #fff !important;
    box-shadow: 0 2px 8px rgba(16, 24, 40, .08);
    opacity: 1 !important;
    visibility: visible !important;
    animation: none !important;
    cursor: pointer;
    transition: transform .2s ease, border-color .15s ease !important;
}

/* zoom icon in the top right corner (when product zoom is on): the heart goes next to it */
.single-product div.product .woocommerce-product-gallery:has(.woocommerce-product-gallery__trigger) .mfn-wish-button {
    right: 63px !important;
}

.single-product div.product .woocommerce-product-gallery .mfn-wish-button:hover {
    border-color: var(--asitek-card-accent) !important;
    transform: scale(1.06);
}

.single-product div.product .woocommerce-product-gallery .mfn-wish-button svg {
    width: 22px;
    height: 22px;
    animation: none;
}

/* the cards' heart colour (assets/css/cb-seo.css) */
.single-product div.product .woocommerce-product-gallery .mfn-wish-button svg .path {
    stroke: rgb(51 83 131) !important;
}

.single-product div.product .woocommerce-product-gallery .mfn-wish-button.tooltip::before,
.single-product div.product .woocommerce-product-gallery .mfn-wish-button.tooltip::after {
    display: none !important;
}

.single-product div.product .woocommerce-product-gallery .mfn-wish-button:hover svg .path {
    stroke: var(--asitek-card-accent) !important;
}

.single-product div.product .woocommerce-product-gallery .mfn-wish-button.loved svg .path {
    fill: var(--asitek-card-accent) !important;
    stroke: var(--asitek-card-accent) !important;
}

.single-product div.product .woocommerce-product-gallery .mfn-wish-button.loved svg {
    animation-name: asitek-wish-pop !important;
    animation-duration: .35s !important;
    animation-timing-function: ease-out !important;
}

.single-product div.product .product_image_wrapper .onsale {
    position: absolute !important;
    top: 15px !important;
    right: auto !important;
    bottom: auto !important;
    left: 15px !important;
    z-index: 5;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 38px !important;
    min-width: 0 !important;
    height: 38px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: #d0312d !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    letter-spacing: -.02em;
    text-align: center;
    white-space: nowrap;
    aspect-ratio: auto !important;
    transform: none !important;
}
