/* =========================================
   VERISURE COMPARISON TABLE
   ========================================= */

.vs-compare {
  --vs-red: #e30613;
  --vs-red-dark: #cf0010;
  --vs-green: #00a37d;
  --vs-no-red: #ed002f;

  --vs-header-grey: #dcddde;
  --vs-column-grey: #f6f6f6;
  --vs-feature-grey: #f3f3f3;
  --vs-section-grey: #e8e8e8;

  --vs-border: #e5e5e5;
  --vs-text: #202020;
  --vs-radius: 14px;

  width: 100%;
  margin: 32px auto;

  color: var(--vs-text);
  font-family: inherit;
}


/* =========================================
   TITLE
   ========================================= */

.vs-compare__title {
  /*margin: 40px 45px;*/

  color: var(--vs-text);

  font-family: inherit;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}


/* =========================================
   TABLE WRAPPER
   ========================================= */

.vs-compare__table-wrap {
  position: relative;

  width: 100%;

  overflow: hidden;

  border: 0;
  border-radius: var(--vs-radius);

  box-sizing: border-box;
}


/* =========================================
   TABLE
   ========================================= */

.vs-compare table {
  width: 100%;
  margin: 0;

  border-collapse: separate;
  border-spacing: 0;

  table-layout: fixed;

  background: #ffffff;
}


/* =========================================
   OUTER EDGES
   ========================================= */

.vs-compare-table tr > *:first-child {
  border-left: 1px solid var(--vs-border);
}

.vs-compare-table tr > *:last-child {
  border-right: 1px solid var(--vs-border);
}

/* =========================================
   SECTION ROWS
   ========================================= */

.vs-section-row th {
  padding: 13px 18px;

  background: var(--vs-section-grey) !important;

  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
}

/* =========================================
   CELLS
   ========================================= */

.vs-compare th,
.vs-compare td {
  padding: 20px 18px;

  border-right: 1px solid var(--vs-border);
  border-bottom: 1px solid var(--vs-border);
  border-left: 0;

  box-sizing: border-box;

  vertical-align: middle;

  line-height: 1.4;

  overflow-wrap: break-word;
}

.vs-compare-table
> thead
th:has(.vs-product-subtitle),
.vs-compare-cloned-header
th:has(.vs-product-subtitle) {
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.vs-product-subtitle {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    text-transform: none;
}

/* =========================================
   HEADER
   Neutral default
   ========================================= */

.vs-compare-table thead th {
  background: var(--vs-header-grey);

  border-bottom: 0;

  font-size: clamp(12px, 0.75rem + 0.25vw, 15px);
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;

  vertical-align: bottom;

  border-radius: 0;
}


/* Only outer corners by default */

.vs-compare-table thead th:first-child {
  text-align: left;

  border-radius:
    var(--vs-radius)
    0
    0
    0;
}

.vs-compare-table thead th:last-child {
  border-radius:
    0
    var(--vs-radius)
    0
    0;
}


/* =========================================
   FEATURE COLUMN
   ========================================= */

.vs-compare tbody th {
  background: #ffffff;

  font-size: 15px;
  font-weight: 600;
  text-align: left;
}

.vs-feature {
  display: flex;

  align-items: center;

  gap: 14px;
}

.vs-feature__icon {
  display: flex;

  flex: 0 0 44px;

  width: 44px;
  height: 44px;

  align-items: center;
  justify-content: center;

  color: var(--vs-red);
}

.vs-feature__icon svg {
  display: block;

  width: 44px;
  height: 44px;

  fill: currentColor;
}

.vs-feature__icon .vs-icon-cutout {
  fill: #ffffff;
}

.vs-feature__text {
  display: block;

  min-width: 0;
}


/* =========================================
   PRODUCT CELLS
   Neutral default
   ========================================= */

.vs-compare-table tbody td {
  background: var(--vs-column-grey);

  font-size: 15px;
  text-align: center;
}


/* =========================================
   STATUS
   ========================================= */

.vs-status {
  display: inline-flex;

  width: 30px;
  height: 30px;

  align-items: center;
  justify-content: center;

  border-radius: 50%;

  box-sizing: border-box;

  color: #ffffff;

  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

.vs-status--yes {
  background: var(--vs-green);
}

.vs-status--no {
  background: var(--vs-no-red);
}

.vs-status--partial {
  display: inline-flex;

  min-height: 30px;
  max-width: 150px;

  padding: 5px 9px;

  align-items: center;
  justify-content: center;

  border: 1px solid #c8c8c8;
  border-radius: 15px;

  box-sizing: border-box;

  background: #ffffff;

  color: #202020;

  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
}

.vs-link {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 5px;
  background: #e30613;
  color: #ffffff !important;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none !important;
}

.vs-link:hover, .vs-link:focus {
    background: #cf0010;
    color: #ffffff !important;
    text-decoration: none !important;
}


/* =========================================
   VERISURE / BRAND HEADER
   ========================================= */

.vs-brand-header {
  display: flex;

  flex-direction: column;

  align-items: center;
  justify-content: flex-end;

  gap: 6px;
}

.vs-brand-logo {
  display: block;

  width: 100px;
  max-width: 100%;
  height: auto;
}

.vs-brand-label {
  display: block;

  font-size: clamp(12px, 0.75rem + 0.25vw, 15px);
  font-weight: 700;
  line-height: 1.2;

  text-transform: uppercase;
  letter-spacing: 0.02em;
}


/* =========================================
   SECTION ROWS
   ========================================= */

.vs-section-row th {
  padding: 13px 18px;

  background: var(--vs-section-grey);

  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
}


/* =========================================
   BEST FOR
   ========================================= */

.vs-best-for th,
.vs-best-for td {
  padding-top: 18px;
  padding-bottom: 18px;
}

.vs-best-for th {
  font-weight: 700;
}

.vs-best-for td {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}


/* =========================================
   VALUE TEXT / BADGES
   ========================================= */

.vs-value-text {
  display: inline-flex;

  min-height: 30px;
  max-width: 150px;

  padding: 6px 10px;

  align-items: center;
  justify-content: center;

  border: 1px solid #c8c8c8;
  border-radius: 16px;

  background: #ffffff;

  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
}


/* =========================================
   LABELS
   ========================================= */

.vs-desktop-label {
  display: inline;
}

.vs-mobile-label {
  display: none;
}


/* =========================================
   DESKTOP BOTTOM CORNERS
   ========================================= */

@media (min-width: 769px) {

  .vs-compare-table
  tbody
  tr:last-child
  > * {
    border-radius: 0;
  }

  .vs-compare-table
  tbody
  tr:last-child
  > *:first-child {
    border-radius:
      0
      0
      0
      var(--vs-radius);
  }

  .vs-compare-table
  tbody
  tr:last-child
  > *:last-child {
    border-radius:
      0
      0
      var(--vs-radius)
      0;
  }

}


/* =========================================
   HIGHLIGHTED PRODUCT COLUMN
   Desktop only

   Add:
   class="vs-compare vs-highlight-column"
   ========================================= */

@media (min-width: 769px) {

  /*
   * Highlighted column = second table column.
   */

  .vs-highlight-column
  .vs-compare-table
  thead
  th:nth-child(2) {
    background: var(--vs-header-grey);

    border-top: 3px solid var(--vs-red);
    border-left: 3px solid var(--vs-red);
    border-right: 3px solid var(--vs-red);

    border-radius: 10px 10px 0 0;
  }

  .vs-highlight-column
  .vs-compare-table
  tbody
  td:nth-child(2) {
    border-left: 3px solid var(--vs-red);
    border-right: 3px solid var(--vs-red);
  }

  .vs-highlight-column
  .vs-compare-table
  tbody
  tr:last-child
  td:nth-child(2) {
    border-bottom: 3px solid var(--vs-red);

    border-radius: 0 0 10px 10px;
  }


  /*
   * Highlight design uses individually
   * rounded header cells.
   */

  .vs-highlight-column
  .vs-compare-table
  thead
  th {
    border-radius:
      var(--vs-radius)
      var(--vs-radius)
      0
      0;
  }

  .vs-highlight-column
  .vs-compare-table
  thead
  th:nth-child(2) {
    border-radius: 10px 10px 0 0;
  }

}


/* =========================================
   CLONED / FIXED HEADER
   ========================================= */

.vs-compare-cloned-table {
  display: none;

  position: fixed;

  top: 0;
  left: 0;

  z-index: 1000;

  margin: 0;

  border: 0;

  border-collapse: separate;
  border-spacing: 0;

  table-layout: fixed;

  box-sizing: border-box;

  background: transparent;

  box-shadow:
    0 6px 8px -3px
    rgba(0, 0, 0, 0.28);
}

.vs-compare-cloned-header {
  display: table-header-group;

  position: static;

  margin: 0;

  border-collapse: separate;
  border-spacing: 0;

  table-layout: fixed;

  background: transparent;
}

.vs-compare-cloned-header th {
  padding: 20px 18px;

  border-right: 1px solid var(--vs-border);
  border-bottom: 1px solid var(--vs-border);

  box-sizing: border-box;

  background: var(--vs-header-grey);

  vertical-align: bottom;

  font-family: inherit;
  font-size: clamp(12px, 0.75rem + 0.25vw, 15px);
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-transform: uppercase;

  border-radius: 0;
}

.vs-compare-cloned-header th:first-child {
  text-align: left;

  border-radius:
    var(--vs-radius)
    0
    0
    0;
}

.vs-compare-cloned-header th:last-child {
  border-radius:
    0
    var(--vs-radius)
    0
    0;
}


/* Highlighted cloned header */

@media (min-width: 769px) {

  .vs-highlight-column
  .vs-compare-cloned-header
  th {
    border-radius:
      var(--vs-radius)
      var(--vs-radius)
      0
      0;
  }

  .vs-highlight-column
  .vs-compare-cloned-header
  th:nth-child(2) {
    border-top: 3px solid var(--vs-red);
    border-left: 3px solid var(--vs-red);
    border-right: 3px solid var(--vs-red);

    border-radius: 10px 10px 0 0;
  }

}


/* =========================================
   TABLET + MOBILE
   <= 768px
   ========================================= */

@media (max-width: 768px) {

  /* =========================================
     COMPONENT
     ========================================= */

  .vs-compare {
    margin: 24px 0;
  }

  /*.vs-compare__title {
    margin: 20px 15px 12px;
  }*/

  .vs-compare__table-wrap {
    width: 100%;

    overflow: hidden;

    box-shadow: none;
  }


  /* =========================================
     TABLE
     ========================================= */

  .vs-compare-table {
    width: 100%;

    table-layout: auto;
  }

  .vs-compare-table colgroup {
    display: none;
  }


  /* =========================================
     MAIN HEADER
     ========================================= */

  .vs-compare-table
  > thead
  > tr {
    display: grid;

    grid-template-columns:
      repeat(
        var(--vs-product-columns),
        minmax(0, 1fr)
      );

    width: 100%;
  }


  /*
   * Hide feature-column header.
   */

  .vs-compare-table
  > thead
  th:first-child {
    display: none;
  }


  .vs-compare-table
  > thead
  th {
    display: flex;

    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;

    min-height: 66px;

    padding: 10px 6px;

    align-items: flex-end;
    justify-content: center;

    border: 0;
    border-right: 1px solid var(--vs-border);
    border-bottom: 1px solid var(--vs-border);

    background: var(--vs-header-grey);

    /*font-size: 11px;*/
    line-height: 1.15;
    text-align: center;
    text-transform: none;

    border-radius: 0;
  }

  .vs-product-subtitle {
    margin-top: 2px;
    font-size: 8px;
  }

  /*
   * First visible product header.
   * nth-child(1) is hidden feature header.
   */

  .vs-compare-table
  > thead
  th:nth-child(2) {
    border-left: 1px solid var(--vs-border);

    border-radius:
      var(--vs-radius)
      0
      0
      0;
  }


  .vs-compare-table
  > thead
  th:last-child {
    border-right: 1px solid var(--vs-border);

    border-radius:
      0
      var(--vs-radius)
      0
      0;
  }


  /* =========================================
     BODY GRID
     ========================================= */

  .vs-compare-table
  tbody
  tr:not(.vs-section-row) {
    display: grid;

    grid-template-columns:
      repeat(
        var(--vs-product-columns),
        minmax(0, 1fr)
      );

    width: 100%;
  }


  /* =========================================
     FEATURE LABEL
     ========================================= */

  .vs-compare-table
  tbody
  tr:not(.vs-section-row)
  > th {
    grid-column: 1 / -1;

    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;

    padding: 11px 12px;

    border: 0;
    border-left: 1px solid var(--vs-border);
    border-right: 1px solid var(--vs-border);
    border-bottom: 1px solid var(--vs-border);

    border-radius: 0 !important;

    background: var(--vs-feature-grey);

    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
  }


  /* =========================================
     PRODUCT VALUES
     ========================================= */

  .vs-compare-table
  tbody
  tr:not(.vs-section-row)
  > td {
    display: flex;

    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;

    min-height: 54px;

    padding: 9px 6px;

    align-items: center;
    justify-content: center;

    border: 0;
    border-right: 1px solid var(--vs-border);
    border-bottom: 1px solid var(--vs-border);

    background: #ffffff;

    font-size: 13px;
    line-height: 1.25;
    text-align: center;
  }


  /* Left outer edge */

  .vs-compare-table
  tbody
  tr:not(.vs-section-row)
  > td:first-of-type {
    border-left: 1px solid var(--vs-border);
  }


  /* Right outer edge */

  .vs-compare-table
  tbody
  tr:not(.vs-section-row)
  > td:last-child {
    border-right: 1px solid var(--vs-border);
  }


  /* =========================================
     SECTION ROW
     ========================================= */

  .vs-compare-table
  tbody
  tr.vs-section-row {
    display: block;

    width: 100%;
  }

  .vs-compare-table
  tbody
  tr.vs-section-row
  > th {
    display: block;

    width: 100% !important;

    padding: 12px 14px;

    border: 0;
    border-left: 1px solid var(--vs-border);
    border-right: 1px solid var(--vs-border);
    border-bottom: 1px solid var(--vs-border);

    border-radius: 0 !important;

    background: var(--vs-section-grey);

    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
  }


  /* =========================================
     MOBILE BOTTOM CORNERS
     ========================================= */

  .vs-compare-table
  tbody
  tr:last-child
  > th {
    border-radius: 0 !important;
  }

  .vs-compare-table
  tbody
  tr:last-child
  > td:first-of-type {
    border-radius:
      0
      0
      0
      var(--vs-radius) !important;
  }

  .vs-compare-table
  tbody
  tr:last-child
  > td:last-child {
    border-radius:
      0
      0
      var(--vs-radius)
      0 !important;
  }


  /* =========================================
     FEATURE ICON
     ========================================= */

  .vs-feature {
    display: block;

    text-align: center;
  }

  .vs-feature__icon {
    display: none;
  }

  .vs-feature__text {
    display: block;

    width: 100%;
  }


  .vs-lock-link {
    padding: 7px 5px;
    font-size: 9px;
  }

  /* =========================================
     BRAND
     ========================================= */

  .vs-brand-header {
    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 3px;
  }

  .vs-brand-logo {
    width: 80px;
    max-width: 100%;
    height: auto;
  }

  .vs-brand-label {
    /*font-size: 11px;*/
    line-height: 1.2;

    text-transform: none;
    letter-spacing: normal;
  }


  /* =========================================
     LABELS
     ========================================= */

  .vs-desktop-label {
    display: none;
  }

  .vs-mobile-label {
    display: inline;
  }


  /* =========================================
     STATUS
     ========================================= */

  .vs-status {
    width: 29px;
    height: 29px;

    font-size: 16px;
  }

  .vs-status--partial {
    min-height: 28px;
    max-width: 95px;

    padding: 4px 9px;

    border-radius: 14px;

    font-size: 10px;
    line-height: 1.15;
  }


  /* =========================================
     VALUE TEXT
     ========================================= */

  .vs-value-text {
    min-height: 28px;
    max-width: 105px;

    padding: 5px 7px;

    border-radius: 14px;

    font-size: 10px;
    line-height: 1.2;
  }


  /* =========================================
     BEST FOR
     ========================================= */

  .vs-best-for > th {
    padding-top: 12px !important;
    padding-bottom: 12px !important;

    font-size: 13px !important;
  }

  .vs-best-for > td {
    min-height: 72px;

    padding: 10px 7px;

    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
  }


  /* =========================================
     CLONED HEADER
     ========================================= */

  .vs-compare-cloned-table {
    border: 0;

    border-collapse: separate;
    border-spacing: 0;

    overflow: visible;

    background: #ffffff;

    border-radius: 0;

    box-shadow:
      0 6px 8px -3px
      rgba(0, 0, 0, 0.28);
  }

  .vs-compare-cloned-header,
  .vs-compare-cloned-header > tr {
    background: transparent;
  }

  .vs-compare-cloned-header tr {
    display: grid;

    grid-template-columns:
      repeat(
        var(--vs-product-columns),
        minmax(0, 1fr)
      );

    width: 100%;
  }

  .vs-compare-cloned-header th:first-child {
    display: none;
  }

  .vs-compare-cloned-header th {
    display: flex;

    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;

    min-height: 66px;

    padding: 10px 6px;

    align-items: flex-end;
    justify-content: center;

    border: 0;
    border-right: 1px solid var(--vs-border);
    border-bottom: 1px solid var(--vs-border);

    background: var(--vs-header-grey);

    /*font-size: 11px;*/
    line-height: 1.15;
    text-align: center;
    text-transform: none;

    border-radius: 0;
  }

  .vs-compare-cloned-header th:nth-child(2) {
    border-left: 1px solid var(--vs-border);

    border-radius:
      var(--vs-radius)
      0
      0
      0;
  }

  .vs-compare-cloned-header th:last-child {
    border-right: 1px solid var(--vs-border);

    border-radius:
      0
      var(--vs-radius)
      0
      0;
  }

  .vs-compare-cloned-header .vs-brand-label {
    /*font-size: 12px;*/

    line-height: 1.2;

    text-transform: none;
    letter-spacing: normal;
  }

  .vs-compare-cloned-header .vs-desktop-label {
    display: none;
  }

  .vs-compare-cloned-header .vs-mobile-label {
    display: inline;
  }


  /* =========================================
     HIGHLIGHT COLUMN - MOBILE
     ========================================= */

  /*
   * No red border on mobile.
   *
   * Highlight is instead shown using
   * background contrast.
   */

  .vs-highlight-column
  .vs-compare-table
  tbody
  tr:not(.vs-section-row)
  > td:nth-child(2) {
    background: var(--vs-header-grey);
  }


  /*
   * Other product columns become lighter.
   */

  .vs-highlight-column
  .vs-compare-table
  tbody
  tr:not(.vs-section-row)
  > td:not(:nth-child(2)) {
    background: var(--vs-column-grey);
  }


  /*
   * Highlighted header.
   */

  .vs-highlight-column
  .vs-compare-table
  > thead
  th:nth-child(2),
  .vs-highlight-column
  .vs-compare-cloned-header
  th:nth-child(2) {
    background: var(--vs-header-grey);

    border-top: 0 !important;
    border-left: 1px solid var(--vs-border) !important;
    border-right: 1px solid var(--vs-border) !important;
  }


  /*
   * Other product headers.
   */

  .vs-highlight-column
  .vs-compare-table
  > thead
  th:not(:first-child):not(:nth-child(2)),
  .vs-highlight-column
  .vs-compare-cloned-header
  th:not(:first-child):not(:nth-child(2)) {
    background: var(--vs-column-grey);
  }


  /*
   * Highlight design uses individually
   * rounded product headers on mobile.
   */

  .vs-highlight-column
  .vs-compare-table
  > thead
  th:not(:first-child),
  .vs-highlight-column
  .vs-compare-cloned-header
  th:not(:first-child) {
    border-radius:
      var(--vs-radius)
      var(--vs-radius)
      0
      0;
  }

}