/* 29.11.2026: таблиці й формули в описі товару і в тексті категорії — той самий вигляд, що в статтях (blog.css) і в редакторі.
   Обгортку .am-table-wrap додає assets/js/content-tables.js. */
:is(.am-product-description__content, .am-shop-seo) .am-table-wrap,
:is(.am-product-description__content, .am-shop-seo) .wp-block-table {
    max-width: 100%;
    margin: 20px 0 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #d7dad5;
    border-radius: 2px;
}

:is(.am-product-description__content, .am-shop-seo) table {
    width: 100% !important;
    height: auto !important;
    margin: 0;
    border: 0;
    border-collapse: collapse;
    border-spacing: 0;
    background: #fff;
    font-size: 15px;
    line-height: 1.45;
}

:is(.am-product-description__content, .am-shop-seo) > table {
    margin: 20px 0 24px;
    border: 1px solid #d7dad5;
}

:is(.am-product-description__content, .am-shop-seo) th,
:is(.am-product-description__content, .am-shop-seo) td {
    padding: 12px 16px;
    border: 0;
    border-right: 1px solid #e3e7e1;
    border-bottom: 1px solid #d7dad5;
    text-align: left;
    vertical-align: top;
}

:is(.am-product-description__content, .am-shop-seo) th:last-child,
:is(.am-product-description__content, .am-shop-seo) td:last-child {
    border-right: 0;
}

:is(.am-product-description__content, .am-shop-seo) tr:last-child > td,
:is(.am-product-description__content, .am-shop-seo) tr:last-child > th {
    border-bottom: 0;
}

:is(.am-product-description__content, .am-shop-seo) thead th,
:is(.am-product-description__content, .am-shop-seo) table > tbody:first-child > tr:first-child > th,
:is(.am-product-description__content, .am-shop-seo) table > tr:first-child > th {
    border-right-color: rgba(255, 255, 255, .22);
    border-bottom: 0;
    background: #3e5338;
    color: #fff;
    font-weight: 600;
    vertical-align: middle;
}

:is(.am-product-description__content, .am-shop-seo) tbody th {
    background: #eef2ec;
    color: #263c25;
    font-weight: 600;
}

:is(.am-product-description__content, .am-shop-seo) tbody tr:nth-child(even) > td {
    background: #f6f8f5;
}

:is(.am-product-description__content, .am-shop-seo) th p,
:is(.am-product-description__content, .am-shop-seo) td p {
    margin: 0;
}

:is(.am-product-description__content, .am-shop-seo) td > :last-child,
:is(.am-product-description__content, .am-shop-seo) th > :last-child {
    margin-bottom: 0;
}

:is(.am-product-description__content, .am-shop-seo) .am-formula,
:is(.am-product-description__content, .am-shop-seo) .is-style-am-formula {
    margin: 20px 0 24px;
    padding: 18px 24px;
    border: 1px solid #c9d6c5;
    border-radius: 2px;
    background: #eef2ec;
    color: #263c25;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.45;
    text-align: center;
    font-variant-numeric: lining-nums tabular-nums;
    overflow-wrap: break-word;
}

:is(.am-product-description__content, .am-shop-seo) .am-formula strong,
:is(.am-product-description__content, .am-shop-seo) .am-formula b,
:is(.am-product-description__content, .am-shop-seo) .is-style-am-formula strong,
:is(.am-product-description__content, .am-shop-seo) .is-style-am-formula b {
    font-weight: inherit;
}

@media (max-width: 767px) {
    :is(.am-product-description__content, .am-shop-seo) table {
        font-size: 14px;
        line-height: 1.4;
    }

    :is(.am-product-description__content, .am-shop-seo) th,
    :is(.am-product-description__content, .am-shop-seo) td {
        padding: 10px 12px;
    }

    :is(.am-product-description__content, .am-shop-seo) .am-table-wrap table:has(tr > :nth-child(3)),
    :is(.am-product-description__content, .am-shop-seo) .wp-block-table table:has(tr > :nth-child(3)) {
        min-width: 600px;
    }

    :is(.am-product-description__content, .am-shop-seo) .am-table-wrap table:has(tr > :nth-child(3)) tr > :first-child,
    :is(.am-product-description__content, .am-shop-seo) .wp-block-table table:has(tr > :nth-child(3)) tr > :first-child {
        white-space: nowrap;
    }

    :is(.am-product-description__content, .am-shop-seo) .am-formula,
    :is(.am-product-description__content, .am-shop-seo) .is-style-am-formula {
        margin: 16px 0 20px;
        padding: 14px 16px;
        font-size: 16px;
    }
}
:is(.am-product-description__content, .am-shop-seo) > table,
:is(.am-product-description__content, .am-shop-seo) p > table {
    margin: 20px 0 24px;
    border: 1px solid #d7dad5;
}

/* 29.11.2026: кнопка «ще N» у рядку «Категорія» на сторінці товару */
.am-cat-more {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: #3e5338;
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
.am-cat-more:hover { color: #263c25; }
