.products-page .products-tool-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.products-page .products-tool-btn {
    min-height: 132px;
    padding: 18px 16px;
    border-radius: 20px;
    gap: 8px;
    overflow: hidden;
}

.products-page .products-tool-btn > span {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 22px;
}

.products-page .products-tool-btn b {
    max-width: 100%;
    font-size: 14px;
    line-height: 1.7;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
}

.products-page .products-tool-btn small {
    max-width: 100%;
    font-size: 11px;
    line-height: 1.6;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
}

/*
   Product row action fallback.
   Some clients render the inline SVG elements as empty inside the compact action
   buttons. Use text glyphs from this non-isolated stylesheet so the controls stay
   visible independently of SVG/scoped-CSS behavior.
*/
.products-page .products-row-actions .products-action {
    position: relative !important;
    display: inline-grid !important;
    place-items: center !important;
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    text-indent: 0 !important;
    overflow: visible !important;
}

.products-page .products-row-actions .products-action svg {
    display: none !important;
}

.products-page .products-row-actions .products-action::before {
    content: "•";
    display: block !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    color: #dbe7f7 !important;
    background: transparent !important;
    font-family: "Segoe UI Symbol", "Arial Unicode MS", Arial, sans-serif !important;
    font-size: 18px !important;
    font-style: normal !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    text-align: center !important;
    text-indent: 0 !important;
    transform: none !important;
}

.products-page .products-row-actions .products-action:nth-child(1)::before {
    content: "✎";
    color: #f59e0b !important;
    font-size: 20px !important;
}

.products-page .products-row-actions .products-action:nth-child(2)::before {
    content: "▧";
    color: #93c5fd !important;
    font-size: 20px !important;
}

.products-page .products-row-actions .products-action:nth-child(3)::before {
    content: "$";
    color: #86efac !important;
    font-size: 17px !important;
    font-weight: 900 !important;
}

.products-page .products-row-actions .products-action:nth-child(4)::before {
    content: "▥";
    color: #c4b5fd !important;
    font-size: 20px !important;
}

.products-page .products-row-actions .products-action:nth-child(5)::before {
    content: "×";
    color: #fb7185 !important;
    font-size: 24px !important;
    font-weight: 900 !important;
}

/* Product advanced-search row actions. */
.product-search-page .product-search-actions {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: 100% !important;
    min-width: 154px;
    margin: 0 auto !important;
    padding: 0 !important;
    white-space: nowrap;
}

.product-search-page .product-search-table th:last-child,
.product-search-page .product-search-table td:last-child {
    text-align: center !important;
}

.product-search-page .product-search-actions .product-search-action {
    position: relative !important;
    display: inline-grid !important;
    place-items: center !important;
    flex: 0 0 34px !important;
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 10px !important;
    border: 1px solid #dbe4f0 !important;
    color: transparent !important;
    background: #ffffff !important;
    font-size: 0 !important;
    line-height: 0 !important;
    text-indent: 0 !important;
    vertical-align: middle !important;
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.product-search-page .product-search-actions .product-search-action::before {
    content: "•";
    display: grid !important;
    place-items: center !important;
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    background: transparent !important;
    font-family: "Segoe UI Symbol", "Arial Unicode MS", Arial, sans-serif !important;
    font-size: 19px !important;
    font-style: normal !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    text-align: center !important;
    text-indent: 0 !important;
    transform: none !important;
}

.product-search-page .product-search-actions .product-search-action:nth-child(1) {
    border-color: #bfdbfe !important;
    background: #eff6ff !important;
}
.product-search-page .product-search-actions .product-search-action:nth-child(1)::before {
    content: "◉";
    color: #2563eb !important;
    font-size: 18px !important;
}

.product-search-page .product-search-actions .product-search-action:nth-child(2) {
    border-color: #fde68a !important;
    background: #fffbeb !important;
}
.product-search-page .product-search-actions .product-search-action:nth-child(2)::before {
    content: "✎";
    color: #d97706 !important;
    font-size: 20px !important;
}

.product-search-page .product-search-actions .product-search-action:nth-child(3) {
    border-color: #ddd6fe !important;
    background: #f5f3ff !important;
}
.product-search-page .product-search-actions .product-search-action:nth-child(3)::before {
    content: "▥";
    color: #7c3aed !important;
    font-size: 20px !important;
}

.product-search-page .product-search-actions .product-search-action:nth-child(4) {
    border-color: #a5f3fc !important;
    background: #ecfeff !important;
}
.product-search-page .product-search-actions .product-search-action:nth-child(4)::before {
    content: "▦";
    color: #0891b2 !important;
    font-size: 20px !important;
}

.product-search-page .product-search-actions .product-search-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .10);
}

/* Product search action tooltip and mobile menu. */
.erp-product-search-tooltip {
    position: fixed;
    z-index: 2147483600;
    max-width: 220px;
    padding: 7px 10px;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 9px;
    color: #f8fafc;
    background: rgba(15, 23, 42, .96);
    box-shadow: 0 10px 28px rgba(2, 6, 23, .28);
    font-family: inherit;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.5;
    direction: rtl;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(3px);
    transition: opacity .12s ease, transform .12s ease, visibility .12s ease;
}

.erp-product-search-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.erp-product-search-mobile-trigger {
    display: none !important;
}

.erp-product-search-mobile-popover {
    position: fixed;
    z-index: 2147483500;
    width: 180px;
    padding: 8px;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .22);
    direction: rtl;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px) scale(.98);
    transform-origin: top left;
    transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}

.erp-product-search-mobile-popover.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.erp-product-search-mobile-item {
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border: 0;
    border-radius: 9px;
    color: #334155;
    background: transparent;
    font-family: inherit;
    font-size: 12px;
    font-weight: 900;
    text-align: right;
    cursor: pointer;
}

.erp-product-search-mobile-item:hover,
.erp-product-search-mobile-item:focus-visible {
    color: #1d4ed8;
    background: #eff6ff;
    outline: 0;
}

body.erpdb-dark .erp-product-search-mobile-popover {
    border-color: var(--erp-theme-border, #2a394f);
    background: var(--erp-theme-surface-raised, #111c30);
    box-shadow: 0 18px 45px rgba(2, 6, 23, .48);
}

body.erpdb-dark .erp-product-search-mobile-item {
    color: var(--erp-theme-text-soft, #dbe7f7);
}

body.erpdb-dark .erp-product-search-mobile-item:hover,
body.erpdb-dark .erp-product-search-mobile-item:focus-visible {
    color: #93c5fd;
    background: rgba(37, 99, 235, .14);
}

/* The two checkbox filter cards carried fixed light backgrounds in the component
   stylesheet. Explicitly bridge them to the authenticated dark-theme tokens. */
body.erpdb-dark .erp-page-reference .product-search-page .product-search-check {
    color: var(--erp-theme-text-soft, #dbe7f7) !important;
    border-color: var(--erp-theme-border, #2a394f) !important;
    background: var(--erp-theme-surface-raised, #111c30) !important;
    box-shadow: none !important;
}

body.erpdb-dark .erp-page-reference .product-search-page .product-search-check > b {
    color: var(--erp-theme-text-soft, #dbe7f7) !important;
}

body.erpdb-dark .erp-page-reference .product-search-page .product-search-check > span {
    border-color: #52637b !important;
    background: #0b1425 !important;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .05) !important;
}

body.erpdb-dark .erp-page-reference .product-search-page .product-search-check input:checked + span {
    border-color: var(--erp-primary, #2563eb) !important;
    background: linear-gradient(135deg, var(--erp-primary, #2563eb), var(--erp-accent, #7c3aed)) !important;
}

body.erpdb-dark .erp-page-reference .product-search-page .product-search-actions .product-search-action {
    border-color: var(--erp-theme-border, #2a394f) !important;
    background: var(--erp-theme-surface-raised, #111c30) !important;
    box-shadow: none !important;
}

body.erpdb-dark .erp-page-reference .product-search-page .product-search-actions .product-search-action:nth-child(1) {
    border-color: rgba(96, 165, 250, .55) !important;
    background: rgba(37, 99, 235, .14) !important;
}

body.erpdb-dark .erp-page-reference .product-search-page .product-search-actions .product-search-action:nth-child(2) {
    border-color: rgba(245, 158, 11, .55) !important;
    background: rgba(245, 158, 11, .10) !important;
}

body.erpdb-dark .erp-page-reference .product-search-page .product-search-actions .product-search-action:nth-child(3) {
    border-color: rgba(167, 139, 250, .55) !important;
    background: rgba(124, 58, 237, .12) !important;
}

body.erpdb-dark .erp-page-reference .product-search-page .product-search-actions .product-search-action:nth-child(4) {
    border-color: rgba(34, 211, 238, .48) !important;
    background: rgba(8, 145, 178, .12) !important;
}

@media (max-width: 1180px) {
    .products-page .products-tool-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .products-page .products-tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    html body .product-search-page .product-search-actions {
        min-width: 44px !important;
        width: 44px !important;
        gap: 0 !important;
    }

    html body .product-search-page .product-search-actions > .product-search-action {
        display: none !important;
    }

    html body .product-search-page .product-search-actions > .erp-product-search-mobile-trigger {
        display: grid !important;
        place-items: center !important;
        width: 38px !important;
        min-width: 38px !important;
        height: 38px !important;
        min-height: 38px !important;
        padding: 0 !important;
        border: 1px solid var(--search-border, #dbe4f0) !important;
        border-radius: 11px !important;
        color: #475569 !important;
        background: #ffffff !important;
        font-family: "Segoe UI Symbol", Arial, sans-serif !important;
        font-size: 25px !important;
        font-weight: 900 !important;
        line-height: 1 !important;
        letter-spacing: 0 !important;
        text-indent: 0 !important;
        cursor: pointer;
    }

    body.erpdb-dark .erp-page-reference .product-search-page .product-search-actions > .erp-product-search-mobile-trigger {
        color: #dbe7f7 !important;
        border-color: var(--erp-theme-border, #2a394f) !important;
        background: var(--erp-theme-surface-raised, #111c30) !important;
    }

    .erp-product-search-tooltip {
        display: none !important;
    }
}

@media (max-width: 620px) {
    .products-page .products-tool-grid {
        grid-template-columns: 1fr;
    }

    .products-page .products-tool-btn {
        min-height: 118px;
    }
}
