/**
 * Features Table Block Styles
 * Custom styling for the features comparison table ACF block
 */

.features-table {
  padding: 50px 0;
}

.features-table .table-overflow-bg {
  position: relative;
}

.features-table
  .table-overflow-bg
  .table-responsive
  .table
  tbody
  tr:first-child
  th {
  border-top: 0;
  position: relative;
}

.features-table
  .table-overflow-bg
  .table-responsive
  .table
  tbody
  tr:first-child
  th:before {
  content: "";
  left: 0;
  top: 0;
  width: calc(100% - 5px);
  position: absolute;
  border-top: 2px solid #9fcf67;
}

.features-table
  .table-overflow-bg
  .table-responsive
  .table
  tbody
  tr:first-child
  th:first-child {
  border-top: 0;
}

.features-table
  .table-overflow-bg
  .table-responsive
  .table
  tbody
  tr:first-child
  th:first-child:before {
  content: none;
}

.features-table
  .table-overflow-bg
  .table-responsive
  .table
  tbody
  tr:first-child
  th:last-child:before {
  width: 100%;
}

.features-table table tr {
  position: relative;
}

.features-table table tr:last-child td,
.features-table table tr:last-child th {
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

.features-table table tr th {
  text-align: center;
  width: 20%;
  vertical-align: middle;
}

.features-table table tr th h3 {
  font-size: 1.25rem;
  line-height: 1.5rem;
  letter-spacing: 1.81818px;
  color: #0978c6;
  font-family: "Roboto Condensed", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
}

.features-table table tr th h3 a {
  font-size: inherit !important;
  font-weight: inherit !important;
  color: inherit !important;
  border-bottom: 2px solid transparent !important;
  text-transform: uppercase !important;
  padding-bottom: 0 !important;
}

.features-table table tr th h3 a:hover {
  color: #9fcf67 !important;
  border-bottom-color: #9fcf67 !important;
}

.features-table table tr th a:not(.btn) {
  font-size: 1rem;
  line-height: 1.25rem;
  color: #000;
  font-family: Roboto, sans-serif;
  font-weight: 700;
  text-transform: capitalize;
  border-bottom: 2px solid #9fcf67;
  padding-bottom: 3px;
}

.features-table table tr th a:not(.btn):focus,
.features-table table tr th a:not(.btn):hover {
  color: #9fcf67;
}

.features-table table tr th a.primary-btn {
  padding: 13px 20px;
  margin-bottom: 15px;
}

.features-table table tr th a.primary-btn ~ a {
  margin-bottom: 20px;
  display: inline-block;
}

.features-table table tr > td:first-child {
  font-size: 0.875rem;
  line-height: 1.3125rem;
  color: #25333c;
  text-align: left;
  font-family: Roboto, sans-serif;
  font-weight: 700;
  background: 0 0;
  padding-left: 0;
  border-right: 0 !important;
}

.features-table table tr td {
  background: #fff;
  text-align: center;
  position: relative;
  vertical-align: middle;
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.features-table table tr td p > a,
.features-table table tr td p > strong,
.features-table table tr td strong {
  font-weight: 700;
}

.features-table table tr td a {
  border-bottom: 2px solid #9fcf67;
  padding-bottom: 2px;
  line-height: 1.625rem !important;
  position: relative;
}

.features-table table tr td a::after {
  content: "\f063";
  font-family: "Font Awesome 5 Pro";
  position: absolute;
  top: 18px;
  font-size: 21px;
  font-weight: 100;
  right: -27px;
  color: #0978c6;
}

.features-table table tr td a:focus,
.features-table table tr td a:hover {
  color: #9fcf67;
}

.features-table table tr td a.primary-btn {
  padding: 13px 20px;
  margin-bottom: 15px;
}

.features-table table tr td a,
.features-table table tr td p,
.features-table table tr td strong {
  font-size: 1.125rem;
  line-height: 1.375rem;
  color: #25333c;
  font-family: Roboto, sans-serif;
  font-weight: 400;
}

.features-table table tr td p {
  margin-bottom: 0;
  padding: 0 11px;
}

.features-table table tr td sub,
.features-table table tr td sup {
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
  color: #25333c;
}

.features-table table tr:last-child th {
  background: transparent;
}

.features-table table tr.features-row-footer td,
.features-table table tr.features-row-footer th {
  border-top: 0 !important;
}

.features-table table tbody tr:has(+ tr.features-row-footer) td,
.features-table table tbody tr:has(+ tr.features-row-footer) th {
  border-bottom: 0;
}

.features-table table tbody tr:has(+ tr.features-row-footer) td:nth-child(2),
.features-table table tbody tr:has(+ tr.features-row-footer) th:nth-child(2) {
  border-bottom-left-radius: 10px;
}

.features-table table tbody tr:has(+ tr.features-row-footer) td:last-child,
.features-table table tbody tr:has(+ tr.features-row-footer) th:last-child {
  border-bottom-right-radius: 10px;
}

.features-table.columns-4
  table
  tbody
  tr:has(+ tr.features-row-footer)
  td:not(:first-child),
.features-table.columns-4
  table
  tbody
  tr:has(+ tr.features-row-footer)
  th:not(:first-child) {
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

.features-table.columns-2
  table
  tbody
  tr:has(+ tr.features-row-footer)
  td:not(:first-child),
.features-table.columns-2
  table
  tbody
  tr:has(+ tr.features-row-footer)
  th:not(:first-child) {
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

.features-table table tr:nth-child(2) td {
  border: none;
}

.features-table table tr:nth-child(2) td:not(:first-child) {
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.features-table table tr:not(:first-child) td:not(:first-child),
.features-table table tr:not(:first-child) td:not(:last-child),
.features-table table tr:not(:first-child) th:not(:first-child),
.features-table table tr:not(:first-child) th:not(:last-child) {
  border-right: none !important;
}

.features-table-qualifying-terms ol {
  margin: 0;
  padding-left: 0;
  list-style-type: none;
}

.features-table-qualifying-terms ol li {
  font-size: 0.75rem;
  line-height: 1.125rem;
  color: #25333c;
  font-family: Roboto, sans-serif;
  font-weight: 400;
  margin-bottom: 20px;
}

.features-table-qualifying-terms p {
  font-size: 0.75rem;
  line-height: 1.125rem;
  color: #25333c;
  font-family: Roboto, sans-serif;
  font-weight: 400;
}

.features-table-qualifying-terms p a {
  font-weight: 700;
  padding-bottom: 3px;
  border-bottom: 2px solid #9fcf67;
}

.features-table-qualifying-terms p a:focus,
.features-table-qualifying-terms p a:hover {
  color: #9fcf67;
}

.features-table-qualifying-content {
  border: 3px solid #fff;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 25px;
  margin-top: 20px;
  max-width: 100% !important;
  position: relative;
}

.features-table-qualifying-content #features-table-qualifying-content {
  position: absolute;
  top: -130px;
  left: 0;
  width: 0;
  height: 0;
  opacity: 0;
}

.features-table-qualifying-content h5 {
  font-size: 0.875rem;
  line-height: 1.3125rem;
  color: #25333c;
  font-family: Roboto, sans-serif;
  font-weight: 700;
}

.features-table-qualifying-content p {
  font-size: 0.875rem;
  line-height: 1.3125rem;
  color: #25333c;
  font-family: Roboto, sans-serif;
  font-weight: 400;
}

.features-table-qualifying-content a {
  font-weight: 700;
  padding-bottom: 3px;
  border-bottom: 2px solid #9fcf67;
  color: inherit;
}

.features-table-qualifying-content a:hover {
  color: #9fcf67;
}

.features-table-qualifying-content ul {
  margin: 0;
  padding: 0;
  list-style-type: none;
}

.features-table-qualifying-content ul li,
.features-table-qualifying-content ul li strong {
  font-size: 0.875rem;
  line-height: 1.3125rem;
  color: #25333c;
  font-family: Roboto, sans-serif;
  font-weight: 700;
}

.features-table-qualifying-content ul li {
  margin-bottom: 10px;
  position: relative;
}

.features-table-qualifying-content ul li:before {
  content: "-";
  margin-right: 7px;
}

/* ===== RESPONSIVE STYLES ===== */

/* Desktop inner dividers (576px+) */
@media (min-width: 576px) {
  .features-table
    table
    tr:not(:first-child)
    td:not(:first-child):not(:last-child),
  .features-table
    table
    tr:not(:first-child)
    th:not(:first-child):not(:last-child) {
    border-right: 2px solid #f4f4f4 !important;
  }
}

/* Tablet & Desktop optimizations (768px+) */
@media (min-width: 768px) {
  .features-table .table-overflow-bg {
    padding-left: 0;
  }
  
  .features-table table tr > td:first-child {
    font-size: 1.125rem;
    line-height: 1.375rem;
  }
  
  .features-table table tr td {
    border-bottom: 1px solid #dee2e6;
  }
  
  .features-table table tr:last-child td {
    border-bottom: 0;
  }
  
  .features-table table tbody tr:has(+ tr.features-row-footer) td,
  .features-table table tbody tr:has(+ tr.features-row-footer) th {
    border-bottom: 0;
  }
  
  .features-table-qualifying-terms ol li {
    font-size: 0.9375rem;
    line-height: 1.375rem;
  }
  
  .features-table-qualifying-terms p {
    font-size: 0.9375rem;
    line-height: 1.375rem;
  }
  
  .features-table-qualifying-content {
    margin-bottom: 45px;
  }
  
  .features-table-qualifying-content h5 {
    font-size: 1.25rem;
    line-height: 1.5625rem;
  }
  
  .features-table-qualifying-content p {
    font-size: 1rem;
    line-height: 1.5625rem;
  }
  
  .features-table-qualifying-content ul li,
  .features-table-qualifying-content ul li strong {
    font-size: 1rem;
    line-height: 1.25rem;
  }
}

/* Mobile stacked card layout (< 576px) */
@media (max-width: 575.98px) {
  /* Keep the whole table scrollable horizontally on very small devices */
  .features-table .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Ensure inner table takes at least full width so that the wrapper can scroll */
  .features-table .table {
    width: 100% !important;
    min-width: 0;
  }

  .features-table td {
    width: 100% !important;
  }

  /* disable any scroll */
  .features-table .table-responsive {
    overflow-x: hidden;
  }

  /* Turn comparison table into stacked cards */
  .features-table table,
  .features-table thead,
  .features-table tbody,
  .features-table tr,
  .features-table th,
  .features-table td {
    display: block;
    width: 100%;
  }

  /* Hide header row */
  .features-table thead,
  .features-table tr:first-child {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  .features-table tr {
    margin-bottom: 1.25rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    padding: 0.75rem 1rem;
  }

  .features-table td {
    border: none;
    position: relative;
    padding: 0.25rem 0 0.75rem 0;
    margin-bottom: 0.75rem;
    white-space: normal;
  }

  .features-table td::before {
    content: attr(data-label);
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #25333c;
  }

  .features-table td:last-child {
    margin-bottom: 0;
  }

  .features-table .table-responsive {
    overflow-x: visible;
  }
}
