/* Hura Cars global table system — site-wide content tables, independent of product/UX template. */
:where(#main,.entry-content,.product,.page,.post) table{
  width:100%;
  max-width:100%;
  border-collapse:collapse;
  border-spacing:0;
  margin:18px 0 24px;
  table-layout:auto;
  white-space:normal;
  background:transparent!important;
}

/* Body cells: no coloured fill. Override old inline cell backgrounds from legacy content. */
:where(#main,.entry-content,.product,.page,.post) table th,
:where(#main,.entry-content,.product,.page,.post) table td{
  border:1px solid #d9d9d9;
  padding:14px 16px!important;
  vertical-align:middle;
  line-height:1.55;
  background:transparent!important;
  background-color:transparent!important;
}

/* Body rows are always unfilled, including the FIRST tbody row. This prevents a table's image row from being mistaken for a header row. */
:where(#main,.entry-content,.product,.page,.post) table tbody > tr > th,
:where(#main,.entry-content,.product,.page,.post) table tbody > tr > td{
  background:transparent!important;
  background-color:transparent!important;
  background-image:none!important;
}

/* Header is the actual THEAD only. */
:where(#main,.entry-content,.product,.page,.post) table thead > tr > th,
:where(#main,.entry-content,.product,.page,.post) table thead > tr > td{
  background:#008669!important;
  background-color:#008669!important;
  background-image:none!important;
  color:#fff!important;
  text-align:center;
  font-weight:700;
  padding:13px 16px!important;
}

/* Legacy tables without a THEAD: use only their first row as the fallback header. */
:where(#main,.entry-content,.product,.page,.post) table:not(:has(thead)) > tbody > tr:first-child > th,
:where(#main,.entry-content,.product,.page,.post) table:not(:has(thead)) > tbody > tr:first-child > td{
  background:#008669!important;
  background-color:#008669!important;
  background-image:none!important;
  color:#fff!important;
  text-align:center;
  font-weight:700;
  padding:13px 16px!important;
}

/* Keep old inline text colours readable in the real header only. */
:where(#main,.entry-content,.product,.page,.post) table thead > tr > th *,
:where(#main,.entry-content,.product,.page,.post) table thead > tr > td *,
:where(#main,.entry-content,.product,.page,.post) table:not(:has(thead)) > tbody > tr:first-child > th *,
:where(#main,.entry-content,.product,.page,.post) table:not(:has(thead)) > tbody > tr:first-child > td *{
  color:#fff!important;
}

/* Keep body links readable; explicit CTA/button backgrounds are not removed. */
:where(#main,.entry-content,.product,.page,.post) table tbody > tr > td a:not(.button){
  color:#006B54;
}

@media (min-width:850px){
  :where(#main,.entry-content,.product,.page,.post) table{
    display:table;
    overflow:visible;
  }
}

@media (max-width:849px){
  :where(#main,.entry-content,.product,.page,.post) table{
    display:block;
    overflow-x:auto;
    overflow-y:visible;
    -webkit-overflow-scrolling:touch;
    font-size:14px;
  }
  :where(#main,.entry-content,.product,.page,.post) table th,
  :where(#main,.entry-content,.product,.page,.post) table td{
    padding:11px 12px!important;
  }
}
