/* =========================================================
   VIEW TOGGLE (segmented control)
   ========================================================= */
.view-toggle {
  display: inline-flex;
  background: #fff;
  border: 1px solid rgb(var(--color-grey));
  border-radius: 30px;
  padding: 4px;
  gap: 4px;
}
.view-toggle__btn {
  font-family: Poppins, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #000;
  background: transparent;
  border: none;
  border-radius: 24px;
  padding: 7px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.18s ease;
}
.view-toggle__btn svg {
  display: block;
}
.view-toggle__btn:hover {
  color: rgb(var(--color-blue-primary));
}
.view-toggle__btn--active {
  background: rgb(var(--color-blue-primary));
  color: #fff;
  box-shadow: 0 2px 6px rgba(var(--color-blue-primary), 0.25);
}
.view-toggle__btn--active:hover {
  color: #fff;
}

/* =========================================================
   FILTER BAR LAYOUT
   ========================================================= */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.filter-bar__spacer {
  flex: 1;
  min-width: 12px;
}
.filter-bar__view-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.filter-bar__count {
  font-size: 13px;
  color: #666;
}
.filter-bar__count strong {
  color: #000;
  font-weight: 600;
}

/* =========================================================
   CARD VIEW
   ========================================================= */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.insurer-card {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: stretch;
  background: #fff;
  border: 1px solid rgb(var(--color-grey));
  border-radius: 20px;
  padding: 22px 24px;
  position: relative;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.insurer-card:hover {
  border-color: rgba(var(--color-blue-primary), 0.45);
  box-shadow: 0 4px 18px rgba(0, 28, 70, 0.06);
}
.insurer-card--selected {
  border-color: rgb(var(--color-blue-primary));
  box-shadow: 0 0 0 3px rgba(var(--color-blue-primary), 0.12),
    0 4px 18px rgba(0, 28, 70, 0.06);
}

.insurer-card__check {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 4px;
}
.insurer-card__check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: rgb(var(--color-blue-primary));
  cursor: pointer;
}

.insurer-card__main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.insurer-card__head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.insurer-card__name {
  font-family: Poppins, sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #000;
  line-height: 1.2;
  margin: 0;
}

.insurer-card__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.insurer-tag {
  font-size: 11px;
  font-weight: 500;
  color: rgb(var(--color-blue-primary));
  background: rgba(var(--color-blue-primary), 0.08);
  border-radius: 4px;
  padding: 2px 8px;
  letter-spacing: 0.01em;
}

.insurer-card__desc {
  font-size: 14px;
  color: #555;
  line-height: 1.55;
  margin: 0;
  text-wrap: pretty;
  max-width: 62ch;
}

.insurer-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.btn-action {
  font-family: Poppins, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgb(var(--color-blue-primary));
  background: #fff;
  border: 1px solid rgb(var(--color-blue-primary));
  border-radius: 6px;
  padding: 7px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.btn-action:hover {
  background: rgb(var(--color-blue-primary));
  color: #fff;
}
.btn-action--filled {
  background: rgb(var(--color-blue-primary));
  color: #fff;
  box-shadow: 0 2px 6px rgba(var(--color-blue-primary), 0.25);
}
.btn-action--filled:hover {
  background: rgb(var(--color-blue-medium));
  border-color: rgb(var(--color-blue-medium));
  color: #fff;
}

/* =========================================================
   PRICE TIERS (right side of card)
   ========================================================= */
.insurer-card__prices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgb(var(--color-grey-light));
  border-radius: 14px;
  padding: 14px 12px 12px;
  align-self: flex-start;
  position: relative;
}

/* Deductible chip — spans full width above the 3 tiers */
.price-deductible {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: -4px -4px 4px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid rgb(var(--color-grey));
  border-radius: 10px;
}
.price-deductible__label {
  color: #666;
  font-weight: 500;
  font-size: 11px;
}
.price-deductible__value {
  color: #000;
  font-weight: 700;
  font-size: 12px;
}

.price-tier {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px;
  border-radius: 10px;
  background: transparent;
  text-align: center;
  position: relative;
  transition: background 0.18s ease;
}
.price-tier__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgb(var(--color-blue-primary));
}
.price-tier__amount {
  font-family: "Zilla Slab", "Poppins", sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #000;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.price-tier__per {
  font-size: 11px;
  color: #777;
  margin-top: -2px;
}

/* =========================================================
   RESULTS TOOLBAR (sort + view toggle)
   ========================================================= */
.results-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* =========================================================
   SORT DROPDOWN
   ========================================================= */
.sort-select {
  font-family: Poppins, sans-serif;
  font-size: 13px;
  height: 36px;
  padding: 0 32px 0 14px;
  border: 1px solid rgb(var(--color-grey));
  border-radius: 18px;
  background-color: #fff;
  color: #000;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230072DA' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
}
.sort-select:focus {
  outline: none;
  border-color: rgb(var(--color-blue-primary));
}

/* =========================================================
   COMPARE BAR (sticky bottom)
   ========================================================= */
.compare-bar {
  position: sticky;
  bottom: 16px;
  z-index: 30;
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid rgb(var(--color-blue-primary));
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(0, 28, 70, 0.12);
  animation: cb-in 0.2s ease;
}
@keyframes cb-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.compare-bar__chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.compare-bar__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgb(var(--color-grey-light));
  border: 1px solid rgb(var(--color-grey));
  border-radius: 16px;
  padding: 4px 6px 4px 10px;
  font-size: 12px;
  color: #000;
}
.compare-bar__chip button {
  background: none;
  border: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.compare-bar__chip button:hover {
  background: rgb(var(--color-grey));
  color: #000;
}
.compare-bar__spacer {
  flex: 1;
}
.compare-bar__count {
  font-size: 14px;
  color: #000;
}
.compare-bar__count strong {
  color: rgb(var(--color-blue-primary));
  font-weight: 700;
}

/* =========================================================
   VIEW TRANSITION
   ========================================================= */
.view-fade {
  animation: view-in 0.22s ease;
}
@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================
   RESPONSIVE — Mobile (max 980px: card layout stacks)
   ========================================================= */
@media (max-width: 980px) {
  .insurer-card {
    grid-template-columns: 28px minmax(0, 1fr);
  }
  .insurer-card__prices {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  /* Toolbar: stack sort + view toggle, beide volledige breedte zodat ze in beeld blijven */
  .results-toolbar {
    justify-content: stretch;
    gap: 8px;
  }
  .results-toolbar .sort-select {
    flex: 1 1 100%;
    width: 100%;
    height: 40px;
  }
  .results-toolbar .view-toggle {
    flex: 1 1 100%;
    width: 100%;
    justify-content: center;
  }
  .results-toolbar .view-toggle__btn {
    flex: 1;
    justify-content: center;
  }

  .filter-bar {
    gap: 16px;
  }
  .filter-bar__view-wrap {
    align-items: flex-start;
    width: 100%;
  }
  .insurer-card {
    padding: 16px;
    gap: 12px;
  }
  .insurer-card__name {
    font-size: 17px;
  }
  .insurer-card__desc {
    font-size: 13px;
  }
  .price-tier__amount {
    font-size: 19px;
  }
  .insurer-card__prices {
    padding: 10px 8px;
  }
  .btn-action {
    padding: 6px 12px;
    font-size: 12px;
  }
  .compare-bar {
    flex-wrap: wrap;
    padding: 12px 14px;
    gap: 10px;
    bottom: 8px;
  }
  .compare-bar__count {
    font-size: 13px;
  }
}
