/*
 Theme Name:   Foogra Child
 Theme URI:    https://themeforest.net/item/foogra-restaurants-directory-listings-wordpress-theme/37317341
 Description:  Foogra Child Theme
 Author:       ApusTheme
 Author URI:   http://apusthemes.com
 Template:     foogra
 Version:      1.0.0
 Text Domain:  foogra-child
*/
.woocommerce-account .woocommerce-MyAccount-navigation {
    width: 25%;
    float: left;
}

.woocommerce-account .woocommerce-MyAccount-content {
    width: 75%;
    float: right;
}

.woocommerce-account .woocommerce-MyAccount-navigation .woocommerce-MyAccount-navigation-link {
    display: block;
    margin-right: 0;
}

:root {
    --foogra-theme-color: #f06c17;
    --foogra-theme-hover-color: #cb5d16;
    --foogra-link_hover_color: #f06c17;
}

/* body {
    background: #fede57;
} */

.listing-list-v2 {
    background: #fff;
}

.cp-category-carousel .category-banner-inner {
    height: 100%;
}

.dokan-report-abuse-button,
#tab-title-seller_enquiry_form,
#tab-title-product_qa,
#ship-to-different-address {
    display: none !important;
}

/* Hide the "View cart" link WooCommerce appends after AJAX add-to-cart on the product loop —
   the mini-cart in the header already provides this, no need for an extra inline button */
.product-block .added_to_cart,
.product-block a.added_to_cart,
.card-add-cart .added_to_cart,
.card-add-cart a.added_to_cart,
.card-add-cart .add-cart .added_to_cart,
.card-add-cart .add-cart a.added_to_cart,
.card-add-cart .add-cart a.wc-forward {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

.woocommerce table.cart td.actions .coupon {
    width: 100%;
    text-align: left;
}

.woocommerce table.cart td.actions .coupon label {
    text-align: left;
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
}

.woocommerce-page table.cart td.actions .coupon .input-text {
    height: 50px;
}

.woocommerce-page table.cart td.actions .coupon .btn {
    height: 50px;
    padding-top: 0;
    padding-bottom: 0;
}

.woocommerce table.shop_table tbody .actions .btn.update_cart {
    height: 50px;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 20px;
}

.dokan-store #apus-breadscrumb {
    display: none;
}

/* ===== Product Card — Dribbble-inspired clean card ===== */

/* Grid: equal height cards, uniform gaps */
.products-grid.row {
    display: flex;
    flex-wrap: wrap;
    row-gap: 24px;
}

.products-grid.row > [class*="col-"] {
    display: flex;
    margin-bottom: 0 !important;
    padding-left: 12px;
    padding-right: 12px;
}

/* Card: single white bg, rounded, subtle shadow */
.product-block.grid {
    border: none !important;
    border-radius: 16px !important;
    padding: 0 !important;
    overflow: hidden;
    background: #fff !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06) !important;
    margin-bottom: 0 !important;
    /* Local stacking context so badge z-indexes (sale, low-stock, "out of stock")
       stay scoped inside the card and don't bleed above the sticky header. */
    isolation: isolate;
    position: relative;
}

.product-block.grid:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
}

.product-block.grid,
.product-block.grid .grid-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

/* Hide old metas completely */
.product-block.grid .metas {
    display: none !important;
}

/* Image — inside the white card, with inner padding */
.product-block.grid .block-inner {
    margin: 12px 12px 0 !important;
    position: relative;
}

.product-block.grid .image {
    border-radius: 12px !important;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    position: relative;
    background: #fff;
}

.product-block.grid .image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease !important;
}

.product-block.grid:hover .image img {
    transform: scale(1.04) !important;
}

/* Badges — positioned on image */
.product-block.grid .sale-perc,
.product-block.grid .onsale,
.product-block.grid .out-of-stock {
    display: none !important;
}

/* Row of left-side badges (sale + low-stock). One absolute container, badges static inside. */
.product-block.grid .image-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 8;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

.product-block.grid .sale-badge,
.product-block.grid .image-badges .sale-badge,
.product-block.grid .image-badges .stock-low-badge {
    position: static;
    display: inline-block;
    background: var(--foogra-theme-color);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 8px;
    line-height: 1.2;
    letter-spacing: 0.01em;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Bare sale-badge fallback (when not in the wrapper, e.g. on the single product page) */
.product-block.grid .sale-badge:not(.image-badges .sale-badge) {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 8;
}

.product-block.grid .image-badges .stock-low-badge {
    background: #ff9500;
    box-shadow: 0 2px 6px rgba(255, 149, 0, 0.35);
}

.product-block.grid .stock-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 8px;
    z-index: 8;
    line-height: 1.2;
}

/* ===== Cart page (/krepselis/) — orange [- N +] pill ===== */
/* Replaces the WC default <input type="number"> via the woocommerce_cart_item_quantity filter.
   Same brand colour as the loop pill but slightly bigger because the cart page has more space. */
.woocommerce-cart-form .product-quantity .quantity-wrapper > label,
.woocommerce-cart-form .product-quantity .quantity {
    /* Hide WC's leftover label/input markup if any plugin re-injects it */
    display: none !important;
}

.cp-cart-item-qty {
    display: inline-flex;
    align-items: center;
    height: 36px;
    min-width: 110px;
    box-sizing: border-box;
    border-radius: 10px;
    background: var(--foogra-theme-color, #f06c17);
    color: #fff;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(240, 108, 23, 0.25);
    position: relative;
    transition: opacity 0.18s ease, box-shadow 0.18s ease;
}

.cp-cart-item-qty.is-loading {
    pointer-events: none;
    background: var(--foogra-theme-hover-color, #cb5d16);
}

.cp-cart-item-qty.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cp-cart-spin 0.6s linear infinite;
}

.cp-cart-item-qty.is-loading .cp-cart-item-qty__btn,
.cp-cart-item-qty.is-loading .cp-cart-item-qty__value {
    visibility: hidden;
}

.cp-cart-item-qty__btn {
    flex: 0 0 auto;
    width: 36px;
    height: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    color: #fff;
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}

.cp-cart-item-qty__btn:hover:not([disabled]) {
    background: rgba(255, 255, 255, 0.18);
}

.cp-cart-item-qty__btn[disabled],
.cp-cart-item-qty[data-at-max="1"] .cp-cart-item-qty__btn--plus {
    opacity: 0.4;
    cursor: not-allowed;
}

.cp-cart-item-qty__value {
    flex: 1 1 auto;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    user-select: none;
    padding: 0 6px;
}

/* Hide "Atnaujinti krepšelį" — qty changes auto-apply via AJAX */
.woocommerce-cart-form .actions input.update_cart,
.woocommerce-cart-form .actions button.update_cart,
.woocommerce-cart-form .actions [name="update_cart"] {
    display: none !important;
}

/* Fly-cart (woo-fly-cart plugin) — neutralize the wrapper sizing so our pill fits nicely
   and pre-empt any default plugin styles that conflict with our pill */
.woofc-area .woofc-item-qty,
.woofc-area .woofc-item-qty-inner {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
}

.woofc-area .cp-cart-item-qty {
    height: 32px;
    min-width: 100px;
}

.woofc-area .cp-cart-item-qty__btn {
    width: 32px;
    font-size: 18px;
}

.woofc-area .cp-cart-item-qty__value {
    font-size: 14px;
}

.outofstock .product-block.grid .image img,
.product-block.grid.is-soldout .image img {
    filter: grayscale(30%) brightness(0.9);
}

/* Card body */
.product-block.grid .card-body {
    padding: 12px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: left;
}

/* Row 1: Product name — bold, prominent */
.product-block.grid .card-body .name {
    font-size: 15px !important;
    font-weight: 600;
    margin: 0 0 4px !important;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-block.grid .card-body .name a {
    color: #1a1a1a;
    text-decoration: none;
}

.product-block.grid .card-body .name a:hover {
    color: var(--foogra-theme-color);
}

/* Row 2: Vendor name + address */
.product-block.grid .vendor-info {
    margin: 0 0 auto;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.product-block.grid .vendor-info .vendor-name {
    font-weight: 500;
    font-size: 12px;
    color: #666;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-block.grid .vendor-info .vendor-name::after {
    content: '\00b7';
    margin-left: 5px;
    color: #ccc;
}

.product-block.grid .vendor-info .vendor-address {
    font-size: 12px;
    color: #999;
    line-height: 1.3;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Row 3: Price left + cart control right — same line on tablet+desktop */
.product-block.grid .card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    gap: 8px;
    flex-wrap: nowrap;
    background: none !important;
    border: 0 !important;
    border-top: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

/* In-cart pill: orange filled stepper that REPLACES the "Į krepšelį" button when product is already in cart.
   Clicking +/- talks straight to WC cart via AJAX (cp_update_cart_qty) and refreshes the mini-cart fragment. */
.product-block.grid .cp-cart-controls {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 8px;
}

/* In-cart pill = "managed" secondary state — outline, calmer than the primary orange CTA.
   When AJAX is in flight, fills back to brand orange to indicate "active write". */
.product-block.grid .in-cart-qty {
    display: inline-flex;
    align-items: center;
    height: 29px;
    min-width: 88px;
    box-sizing: border-box;
    border-radius: 10px;
    background: #fff;
    color: #111;
    border: 1.5px solid var(--foogra-theme-color, #f06c17);
    overflow: hidden;
    transition: background-color 0.18s ease, border-color 0.18s ease;
    position: relative;
}

.product-block.grid .in-cart-qty.is-loading {
    pointer-events: none;
    background: var(--foogra-theme-color, #f06c17);
    border-color: var(--foogra-theme-color, #f06c17);
}

.product-block.grid .in-cart-qty.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cp-cart-spin 0.6s linear infinite;
}

.product-block.grid .in-cart-qty.is-loading .in-cart-qty__value,
.product-block.grid .in-cart-qty.is-loading .in-cart-qty__btn {
    visibility: hidden;
}

.product-block.grid .in-cart-qty__btn {
    flex: 0 0 auto;
    width: 28px;
    height: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--foogra-theme-color, #f06c17);
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, opacity 0.15s ease, color 0.15s ease;
}

.product-block.grid .in-cart-qty__btn:hover:not([disabled]) {
    background: rgba(240, 108, 23, 0.1);
}

/* While loading, force white so spinner siblings stay legible should they leak through */
.product-block.grid .in-cart-qty.is-loading .in-cart-qty__btn,
.product-block.grid .in-cart-qty.is-loading .in-cart-qty__value {
    color: #fff;
}

/* + at stock ceiling — visually disabled, click is also blocked in JS */
.product-block.grid .in-cart-qty__btn[disabled],
.product-block.grid .in-cart-qty[data-at-max="1"] .in-cart-qty__btn--plus {
    opacity: 0.35;
    cursor: not-allowed;
}

.product-block.grid .in-cart-qty__btn:focus-visible {
    outline: 2px solid var(--foogra-theme-color, #f06c17);
    outline-offset: -3px;
}

.product-block.grid .in-cart-qty__value {
    flex: 1 1 auto;
    min-width: 22px;
    padding: 0 4px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #111;
    line-height: 1;
    user-select: none;
}


/* Quantity stepper — compact pill, sits between price and add-to-cart */
.product-block.grid .loop-qty {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    height: 32px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    overflow: hidden;
}

.product-block.grid .loop-qty__btn {
    width: 26px;
    height: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    color: #111;
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.product-block.grid .loop-qty__btn:hover {
    background: #f5f6f7;
}

.product-block.grid .loop-qty__btn:focus-visible {
    outline: 2px solid var(--foogra-theme-color, #f06c17);
    outline-offset: -2px;
}

.product-block.grid .loop-qty__input {
    width: 28px;
    height: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #111;
    -moz-appearance: textfield;
}

.product-block.grid .loop-qty__input::-webkit-inner-spin-button,
.product-block.grid .loop-qty__input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.product-block.grid .loop-qty__input:focus {
    outline: none;
}

.product-block.grid .price-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    justify-content: flex-start !important;
    text-align: left !important;
    gap: 6px;
}

.product-block.grid .price-wrap .price {
    justify-content: flex-start !important;
    text-align: left !important;
}

/* New price: big, bold, orange */
.product-block.grid .price-wrap .price {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: var(--foogra-theme-color) !important;
    line-height: 1.2;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.product-block.grid .price-wrap .price ins {
    text-decoration: none !important;
    color: var(--foogra-theme-color) !important;
    font-weight: 800 !important;
    font-size: 18px !important;
    order: -1;
}

/* Old price: smaller, grey, strikethrough, after new price */
.product-block.grid .price-wrap .price del {
    font-size: 13px !important;
    font-weight: 400 !important;
    color: #bbb !important;
    opacity: 1 !important;
    order: 1;
}

.product-block.grid .price-wrap .price .screen-reader-text {
    clip: rect(0, 0, 0, 0) !important;
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* Add to cart — compact 88×29 pill on the right of the footer */
.product-block.grid .card-add-cart,
.product-block.grid .card-add-cart .add-cart {
    position: static !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    display: inline-flex;
    flex-shrink: 0;
    margin: 0;
}

.product-block.grid .card-add-cart a,
.product-block.grid .card-add-cart .add-cart a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: var(--foogra-theme-color) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 0 16px !important;
    font-size: 0 !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    transition: background 0.2s ease !important;
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box !important;
    min-width: 88px !important;
    height: 29px !important;
    width: auto !important;
}

.product-block.grid .card-add-cart a::before,
.product-block.grid .card-add-cart .add-cart a::before {
    content: 'Į krepšelį';
    font-size: 13px;
    font-weight: 600;
}

.product-block.grid .card-add-cart a:hover,
.product-block.grid .card-add-cart .add-cart a:hover {
    background: var(--foogra-theme-hover-color) !important;
}

.product-block.grid .card-add-cart a:active,
.product-block.grid .card-add-cart .add-cart a:active {
    transform: scale(0.96);
}

/* Loading state — button keeps its 88×29 box; spinner centers; text becomes invisible.
   `visibility: hidden` on ::before keeps the text box reserving width, the explicit min-width
   on the anchor guarantees ≥88px even when something else collapses the pseudo. */
.product-block.grid .card-add-cart a.loading,
.product-block.grid .card-add-cart .add-cart a.loading {
    pointer-events: none;
    position: relative;
    background: var(--foogra-theme-hover-color, #cb5d16) !important;
}

.product-block.grid .card-add-cart a.loading::before,
.product-block.grid .card-add-cart .add-cart a.loading::before {
    visibility: hidden;
}

.product-block.grid .card-add-cart a.loading::after,
.product-block.grid .card-add-cart .add-cart a.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cp-cart-spin 0.6s linear infinite;
}

@keyframes cp-cart-spin {
    to { transform: rotate(360deg); }
}

/* Success state — green pill with check + "Pridėta" for ~1.6s, then JS resets */
.product-block.grid .card-add-cart a.added,
.product-block.grid .card-add-cart .add-cart a.added {
    background: #2bb673 !important;
    animation: cp-cart-pop 0.32s ease-out;
}

.product-block.grid .card-add-cart a.added::before,
.product-block.grid .card-add-cart .add-cart a.added::before {
    content: '✓ Pridėta' !important;
}

@keyframes cp-cart-pop {
    0%   { transform: scale(0.96); }
    60%  { transform: scale(1.06); }
    100% { transform: scale(1); }
}

/* View button for out-of-stock — outline style */
.product-block.grid .card-view-btn {
    flex-shrink: 0;
}

.product-block.grid .card-view-btn a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    color: #666 !important;
    border: 1.5px solid #ddd !important;
    border-radius: 10px !important;
    padding: 8px 16px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    transition: all 0.2s ease !important;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.product-block.grid .card-view-btn a:hover {
    border-color: var(--foogra-theme-color) !important;
    color: var(--foogra-theme-color) !important;
}

/* Disable old hover behavior */
.product-block.grid:hover .top-metas {
    visibility: visible !important;
    opacity: 1 !important;
}

/* ===== Sidebar Filter Lists (City, Categories) ===== */
.betili-city-filter {
    margin-bottom: 20px;
}

.betili-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.betili-filter-list .filter-item {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #f0f0f0;
}

.betili-filter-list .filter-item:last-child {
    border-bottom: none;
}

.betili-filter-list .filter-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    font-size: 14px;
    color: #555;
    text-decoration: none;
    transition: all 0.15s ease;
    border-radius: 6px;
}

.betili-filter-list .filter-item a:hover {
    background: #f8f8f8;
    color: #333;
}

.betili-filter-list .filter-item.active a {
    background: var(--foogra-theme-color);
    color: #fff;
    font-weight: 600;
}

.betili-filter-list .filter-item .count {
    font-size: 12px;
    opacity: 0.6;
}

.betili-filter-list .filter-item.active .count {
    opacity: 0.8;
}

@media (max-width: 575px) {
    .product-block.grid .block-inner {
        margin: 8px 8px 0 !important;
    }

    .product-block.grid .card-body {
        padding: 10px 12px 12px;
    }

    .product-block.grid .card-body .name {
        font-size: 13px !important;
    }

    .product-block.grid .vendor-info .vendor-name,
    .product-block.grid .vendor-info .vendor-address {
        font-size: 11px;
    }

    .product-block.grid .price-wrap .price,
    .product-block.grid .price-wrap .price ins {
        font-size: 14px !important;
    }

    .product-block.grid .card-add-cart a,
    .product-block.grid .card-add-cart .add-cart a {
        padding: 7px 12px !important;
    }

    .product-block.grid .card-add-cart a::before,
    .product-block.grid .card-add-cart .add-cart a::before {
        font-size: 12px;
    }
}
/* ===== Mobile (≤767px, 2 cards/row): stack price+button, full-width controls =====
   This block is at the END of the file on purpose — at narrow widths every desktop !important
   on width/height/display would otherwise win on source-order tie. */
@media (max-width: 767px) {
    .product-block.grid .card-body {
        padding: 12px 12px 14px !important;
    }
    .product-block.grid .card-footer {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        flex-wrap: nowrap !important;
        gap: 10px !important;
        margin-top: 10px !important;
    }
    .product-block.grid .price-wrap,
    .product-block.grid .price-wrap .price {
        justify-content: flex-start !important;
        text-align: left !important;
        align-self: flex-start !important;
        flex: 0 0 auto !important;
        width: 100% !important;
    }
    .product-block.grid .cp-cart-controls {
        width: 100% !important;
    }
    .product-block.grid .card-add-cart,
    .product-block.grid .card-add-cart .add-cart {
        display: block !important;
        width: 100% !important;
        flex: 0 0 100% !important;
        flex-shrink: 1 !important;
    }
    .product-block.grid .card-add-cart a,
    .product-block.grid .card-add-cart .add-cart a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: 32px !important;
        border-radius: 12px !important;
    }
    .product-block.grid .card-add-cart a.loading::after,
    .product-block.grid .card-add-cart .add-cart a.loading::after {
        width: 20px !important;
        height: 20px !important;
        margin: -10px 0 0 -10px !important;
    }
    .product-block.grid .in-cart-qty {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: 32px !important;
        justify-content: space-between !important;
        border-radius: 12px !important;
    }
    .product-block.grid .in-cart-qty__btn {
        width: 38px !important;
        font-size: 16px !important;
    }
    .product-block.grid .in-cart-qty__value {
        font-size: 14px !important;
    }
    .product-block.grid .in-cart-qty.is-loading::after {
        width: 20px !important;
        height: 20px !important;
        margin: -10px 0 0 -10px !important;
    }
    .product-block.grid .card-view-btn {
        display: block !important;
        width: 100% !important;
        flex: 0 0 100% !important;
    }
    .product-block.grid .card-view-btn a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        height: 32px !important;
        padding: 0 16px !important;
        border-radius: 12px !important;
    }
}

/* ===== Shop page (/pasiulymai/) filters: chips on the left + count/sort on the right ===== */
.cp-shop-filters {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin: 16px 0 24px;
}

.cp-shop-filters__chips {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cp-shop-filters__sort {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    padding-top: 4px;
}

.cp-shop-filters__sort .woocommerce-result-count {
    margin: 0 !important;
    font-size: 12px;
    line-height: 1;
    color: #9a9a9a;
    order: 1;
}

.cp-shop-filters__sort .orderby-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    order: 2;
}

.cp-shop-filters__sort .orderby-wrapper .subtitle {
    font-size: 12px;
    font-weight: 600;
    color: #7a7a7a;
    margin: 0;
}

.cp-shop-filters__sort .woocommerce-ordering {
    margin: 0 !important;
}

.cp-shop-filters__sort select.orderby {
    height: 32px;
    padding: 0 32px 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23666' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 5 6 8 9 5'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px 12px;
}

.cp-shop-filters__sort select.orderby:hover {
    border-color: var(--foogra-theme-color, #f06c17);
}

/* Old single-block class kept for backwards-compat; same gap behaviour */
.cp-shop-chips {
    margin: 16px 0 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cp-chip-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.cp-chip-row__label {
    flex: 0 0 auto;
    padding-top: 7px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #7a7a7a;
    min-width: 90px;
}

.cp-chip-row__items {
    flex: 1 1 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    border-radius: 999px;
    background: #fff;
    color: #1a1a1a;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
}

.cp-chip:hover {
    border-color: var(--foogra-theme-color, #f06c17);
    color: var(--foogra-theme-color, #f06c17);
    transform: translateY(-1px);
}

.cp-chip.is-active {
    background: var(--foogra-theme-color, #f06c17);
    color: #fff;
    border-color: var(--foogra-theme-color, #f06c17);
}

.cp-chip.is-active:hover {
    background: var(--foogra-theme-hover-color, #cb5d16);
    color: #fff;
}

.cp-chip__count {
    display: inline-block;
    min-width: 18px;
    padding: 0 6px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.06);
    font-size: 11px;
    font-weight: 700;
    color: inherit;
}

.cp-chip.is-active .cp-chip__count {
    background: rgba(255, 255, 255, 0.22);
}

/* Mobile: stack label above chips */
@media (max-width: 575px) {
    .cp-chip-row {
        flex-direction: column;
        gap: 6px;
    }
    .cp-chip-row__label {
        padding-top: 0;
        min-width: 0;
    }
}

/* ===== Shop page (/pasiulymai/) layout cleanup =====
   Our chip filters (cities + categories) replace the sidebar's category list and the loud
   "Rikiuoti pagal:" label. Drop the sidebar entirely on the archive, expand main, tidy the
   count + sort row. */
body.woocommerce.archive .sidebar-wrapper,
body.woocommerce.archive .mobile-sidebar-btn {
    display: none !important;
}

body.woocommerce.archive #main-content.archive-shop {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Hide the legacy dokan-geolocation form on the shop page (we have chips now) */
body.woocommerce.archive .dokan-geolocation-location-filters {
    display: none !important;
}

/* The theme's own filter bar is a duplicate now — we render result-count + sort inside
   .cp-shop-filters__sort. Hide it. */
body.woocommerce.archive .wrapper-fillter {
    display: none !important;
}

/* Many cities/categories: keep them on a single row per chip-row, scrollable horizontally
   if they overflow. The label stays fixed on the left, chips scroll inside their container. */
body.woocommerce.archive .cp-chip-row__items {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: #d4d6da transparent;
    -webkit-overflow-scrolling: touch;
    /* Soft fade hint on the right edge so the user notices there's more to scroll */
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
            mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
}

body.woocommerce.archive .cp-chip-row__items::-webkit-scrollbar {
    height: 4px;
}
body.woocommerce.archive .cp-chip-row__items::-webkit-scrollbar-thumb {
    background: #d4d6da;
    border-radius: 2px;
}

/* Shop filters on mobile (≤767px):
   - whole bar stacks vertically
   - each chip row = label on top, scrollable chips below
   - sort block = count on top, orderby dropdown below, both right-aligned */
@media (max-width: 767px) {
    /* Mobile bar = single row: [Rodoma 1-12 iš 32]   [⚙ Filtrai]
       Chips block is repositioned out of flow as a fixed drawer (rules below). */
    .cp-shop-filters {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .cp-shop-filters__sort {
        order: 1;
        flex: 1 1 auto;
        min-width: 0;
        flex-direction: row;
        align-items: center;
        gap: 0;
        padding-top: 0;
    }
    .cp-shop-filters__sort .woocommerce-result-count {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 12px;
        color: #9a9a9a;
        margin: 0 !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    /* Sort dropdown is dropped on mobile (the [Numatytasis ▾] select pushed the row out
       of the viewport at ≤380px and was visually redundant with chips). */
    .cp-shop-filters__sort .orderby-wrapper {
        display: none !important;
    }

    /* Inside-drawer chip layout: label on top, chips below */
    .cp-shop-filters__chips {
        gap: 14px;
    }
    .cp-shop-filters__chips .cp-chip-row {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    .cp-shop-filters__chips .cp-chip-row__label {
        padding-top: 0;
        min-width: 0;
    }
}

/* ===== Mobile filters drawer (≤767px) =====
   Desktop: chips inline, drawer-related elements hidden via specificity below. */
.cp-filters-toggle,
.cp-filters-close,
.cp-filters-drawer-head,
.cp-filters-backdrop {
    display: none;
}

@media (max-width: 767px) {
    /* Filter toggle button — direct child of .cp-shop-filters, lives on the right side */
    .cp-filters-toggle {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        height: 32px;
        padding: 0 14px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        background: #fff;
        font-size: 13px;
        font-weight: 600;
        color: #1a1a1a;
        cursor: pointer;
        transition: border-color 0.15s ease, color 0.15s ease;
        flex: 0 0 auto;
        order: 2;
    }
    .cp-filters-toggle:hover {
        border-color: var(--foogra-theme-color, #f06c17);
        color: var(--foogra-theme-color, #f06c17);
    }
    .cp-filters-toggle__count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 9px;
        background: var(--foogra-theme-color, #f06c17);
        color: #fff;
        font-size: 11px;
        font-weight: 700;
    }

    /* Hide chips bar inline; turn it into a fixed right-side drawer */
    .cp-shop-filters__chips {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 88%;
        max-width: 360px;
        z-index: 10001;
        background: #fff;
        padding: 18px 20px 20px;
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
        transform: translateX(100%);
        transition: transform 0.28s ease;
        overflow-y: auto;
        gap: 22px !important;
    }
    .cp-shop-filters.is-open .cp-shop-filters__chips {
        transform: translateX(0);
    }

    /* Drawer head */
    .cp-filters-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 12px;
        border-bottom: 1px solid #ebedf0;
        margin-bottom: 4px;
    }
    .cp-filters-drawer__title {
        margin: 0;
        font-size: 18px;
        font-weight: 700;
        color: #1a1a1a;
    }
    .cp-filters-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border: 0;
        padding: 0;
        background: transparent;
        color: #1a1a1a;
        cursor: pointer;
        border-radius: 8px;
        transition: background-color 0.15s ease;
    }
    .cp-filters-close:hover {
        background: #f5f6f7;
    }

    /* Inside the drawer, chips wrap freely (no horizontal scroll needed) */
    .cp-shop-filters__chips .cp-chip-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .cp-shop-filters__chips .cp-chip-row__label {
        padding-top: 0;
        min-width: 0;
    }
    body.woocommerce.archive .cp-shop-filters__chips .cp-chip-row__items {
        flex-wrap: wrap;
        overflow: visible;
        margin: 0;
        padding: 0;
        -webkit-mask-image: none;
                mask-image: none;
    }

    /* Backdrop */
    .cp-filters-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 10000;
        background: rgba(0, 0, 0, 0);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.28s ease, background-color 0.28s ease, visibility 0s linear 0.28s;
    }
    .cp-shop-filters.is-open .cp-filters-backdrop {
        background: rgba(0, 0, 0, 0.45);
        opacity: 1;
        visibility: visible;
        transition: opacity 0.28s ease, background-color 0.28s ease, visibility 0s linear 0s;
    }

    /* Body scroll lock when drawer is open */
    body.cp-filters-locked {
        overflow: hidden;
    }
}
