/* Thành Phát EV v0.0.83 — technical tables in posts AND WooCommerce product descriptions.
   v0.0.82 targeted only .tpa-prose on posts/pages and was not enqueued on products.
   These selectors intentionally exclude cart/checkout, reviews, WC attribute & variation tables. */

/* Editorial content wrappers: WordPress posts, pages, UX Blocks and product descriptions. */
:is(
  body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.woocommerce-account) .tpa-prose,
  .tpa-category-content-body,
  body.single-product .woocommerce div.product .woocommerce-tabs #tab-description,
  body.single-product .woocommerce div.product .woocommerce-tabs .woocommerce-Tabs-panel--description
) :is(figure.wp-block-table, .wp-block-table) {
  box-sizing: border-box;
  width: 100% !important;
  max-width: 100% !important;
  margin: 20px 0 26px !important;
  overflow-x: auto;
  border: 1px solid #d9e9f2;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 19px rgba(8,45,75,.035);
  -webkit-overflow-scrolling: touch;
}

:is(
  body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.woocommerce-account) .tpa-prose,
  .tpa-category-content-body,
  body.single-product .woocommerce div.product .woocommerce-tabs #tab-description,
  body.single-product .woocommerce div.product .woocommerce-tabs .woocommerce-Tabs-panel--description
) table:not(.shop_table):not(.shop_attributes):not(.variations):not(.woocommerce-product-attributes) {
  box-sizing: border-box !important;
  display: table !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  margin: 20px 0 26px !important;
  border: 1px solid #d9e9f2 !important;
  border-radius: 14px !important;
  overflow: hidden;
  background: #fff !important;
  box-shadow: 0 6px 19px rgba(8,45,75,.035);
  font-size: 15px;
  line-height: 1.55;
  color: #173b56;
}

/* The figure owns the rounded outline when Gutenberg wraps the table. */
:is(
  .tpa-prose,
  .tpa-category-content-body,
  body.single-product .woocommerce div.product .woocommerce-tabs #tab-description
) .wp-block-table > table {
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

:is(
  body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.woocommerce-account) .tpa-prose,
  .tpa-category-content-body,
  body.single-product .woocommerce div.product .woocommerce-tabs #tab-description,
  body.single-product .woocommerce div.product .woocommerce-tabs .woocommerce-Tabs-panel--description
) table:not(.shop_table):not(.shop_attributes):not(.variations):not(.woocommerce-product-attributes) :is(th,td) {
  box-sizing: border-box !important;
  border: 0 !important;
  border-bottom: 1px solid #e5eef4 !important;
  padding: 13px 16px !important;
  text-align: left !important;
  vertical-align: middle !important;
  font-size: inherit !important;
  line-height: 1.5 !important;
  overflow-wrap: anywhere;
  background: transparent;
}

:is(
  body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.woocommerce-account) .tpa-prose,
  .tpa-category-content-body,
  body.single-product .woocommerce div.product .woocommerce-tabs #tab-description,
  body.single-product .woocommerce div.product .woocommerce-tabs .woocommerce-Tabs-panel--description
) table:not(.shop_table):not(.shop_attributes):not(.variations):not(.woocommerce-product-attributes) tr:last-child > :is(th,td) {
  border-bottom: 0 !important;
}

:is(
  body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.woocommerce-account) .tpa-prose,
  .tpa-category-content-body,
  body.single-product .woocommerce div.product .woocommerce-tabs #tab-description,
  body.single-product .woocommerce div.product .woocommerce-tabs .woocommerce-Tabs-panel--description
) table:not(.shop_table):not(.shop_attributes):not(.variations):not(.woocommerce-product-attributes)
:is(thead tr, tbody tr:first-child:has(> th)) > :is(th,td) {
  background: #eaf6fb !important;
  color: #073c5c !important;
  font-weight: 700 !important;
  border-bottom: 1px solid #cfe5ef !important;
}

:is(
  body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.woocommerce-account) .tpa-prose,
  .tpa-category-content-body,
  body.single-product .woocommerce div.product .woocommerce-tabs #tab-description,
  body.single-product .woocommerce div.product .woocommerce-tabs .woocommerce-Tabs-panel--description
) table:not(.shop_table):not(.shop_attributes):not(.variations):not(.woocommerce-product-attributes) tbody tr:nth-child(even) > :is(th,td) {
  background: #f6fafc !important;
}

:is(
  body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.woocommerce-account) .tpa-prose,
  .tpa-category-content-body,
  body.single-product .woocommerce div.product .woocommerce-tabs #tab-description,
  body.single-product .woocommerce div.product .woocommerce-tabs .woocommerce-Tabs-panel--description
) table:not(.shop_table):not(.shop_attributes):not(.variations):not(.woocommerce-product-attributes) tbody > tr:hover > :is(th,td) {
  background: #eff9fc !important;
}

:is(
  body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.woocommerce-account) .tpa-prose,
  .tpa-category-content-body,
  body.single-product .woocommerce div.product .woocommerce-tabs #tab-description,
  body.single-product .woocommerce div.product .woocommerce-tabs .woocommerce-Tabs-panel--description
) table:not(.shop_table):not(.shop_attributes):not(.variations):not(.woocommerce-product-attributes) tr > :first-child {
  width: 32% !important;
  color: #184a68;
  font-weight: 600;
}

:is(
  body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.woocommerce-account) .tpa-prose,
  .tpa-category-content-body,
  body.single-product .woocommerce div.product .woocommerce-tabs #tab-description,
  body.single-product .woocommerce div.product .woocommerce-tabs .woocommerce-Tabs-panel--description
) table:not(.shop_table):not(.shop_attributes):not(.variations):not(.woocommerce-product-attributes) :is(th,td) p {
  margin: 0 !important;
  line-height: inherit;
}

@media(max-width:767px) {
  :is(
    body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.woocommerce-account) .tpa-prose,
    .tpa-category-content-body,
    body.single-product .woocommerce div.product .woocommerce-tabs #tab-description,
    body.single-product .woocommerce div.product .woocommerce-tabs .woocommerce-Tabs-panel--description
  ) table:not(.shop_table):not(.shop_attributes):not(.variations):not(.woocommerce-product-attributes) {
    font-size: 14px !important;
    margin: 16px 0 22px !important;
    border-radius: 12px !important;
  }
  :is(
    body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.woocommerce-account) .tpa-prose,
    .tpa-category-content-body,
    body.single-product .woocommerce div.product .woocommerce-tabs #tab-description,
    body.single-product .woocommerce div.product .woocommerce-tabs .woocommerce-Tabs-panel--description
  ) table:not(.shop_table):not(.shop_attributes):not(.variations):not(.woocommerce-product-attributes) :is(th,td) {
    padding: 11px 12px !important;
  }
  :is(
    body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.woocommerce-account) .tpa-prose,
    .tpa-category-content-body,
    body.single-product .woocommerce div.product .woocommerce-tabs #tab-description,
    body.single-product .woocommerce div.product .woocommerce-tabs .woocommerce-Tabs-panel--description
  ) table:not(.shop_table):not(.shop_attributes):not(.variations):not(.woocommerce-product-attributes) tr > :first-child {
    width: 38% !important;
  }
}
