/*css duplicate same: box/result/filter-buttons/buttons*/

/*Header of the results consisting: number of results/set filter/sorting*/
.recommendation-header {
  border-radius: 4px;
  background-color: white;
  padding: 10px;
  border: 1px solid lightgrey;
}

.recommendation-header > div {
  display: flex;
}

.recommendation-header > div > h5 {
  margin-top: auto;
  margin-bottom: auto;
  color: #456fb6;
}

.top-three > .recommended {
  position: absolute;
  font-size: 1.875rem;
  left: -60px;
  border-radius: 4px;
  background-color: white;
  padding: 10px;
  border: 1px solid lightgrey;
}

.top-three > .recommended.hide {
  display: none;
}

.recommended.first {
  top: 90px;
}

.recommended.second {
  top: 300px;
}

.recommended.third {
  top: 510px;
}

.result-header {
  display: grid;
  grid-template-columns: 4fr 1fr;
  grid-column-gap: 2%;
  border-radius: 4px;
  background-color: white;
  margin: 0 5px;
  padding: 10px;
  border: 1px solid lightgrey;
}

.result-header > .results {
  display: flex;
  flex-direction: column;
}

.result-header > .results > h5 {
  margin-top: auto;
  margin-bottom: auto;
  color: #456fb6;
}

.result-header > .results > h5 > span {
  font-size: 1.14rem;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
}

.button {
  display: flex;
  border-radius: 4px;
  background-color: white;
  border: 1px solid lightgrey;
  margin-right: 10px;
  margin-top: 10px;
  padding: 4px;
  padding-left: 8px;
}

.button:hover {
  cursor: pointer;
  background-color: #f4f4f491;
}

.button > span:first-child {
  margin-right: 3px;
}

.button > .material-icons.close {
  padding-top: 3px;
}

.sort-container {
  display: flex;
  margin-top: auto;
}

.sort-header {
  margin-top: auto;
  width: 100%;
}

#sort {
  font-size: 0.875rem;
  height: 32px;
}

.btn.add-filter-mobile {
  display: flex;
  width: 20%;
  margin-left: auto;
  margin-right: 5px;
  margin-top: 5px;
}

.btn.add-filter-mobile > span {
  font-size: 18px;
  margin-top: 3px;
  color: white;
}

/*Result of the search*/
.top-three {
  position: relative;
  border: 1px solid #ffdccf;
  background-color: #ffecca;
  padding: 0 10px;
  margin: 13px 0;
}

.result {
  display: flex;
  flex-direction: column;
  padding: 5px;
  grid-column-gap: 20px;
  border-radius: 4px;
  background-color: white;
  margin: 13px 5px;
  border: 1px solid lightgrey;
  position: relative;
}

.result.hide {
  display: none;
}

.result:hover {
  box-shadow: 1px 1px 13px rgba(32,39,47,.1);
}

.top-three .result {
  margin: 13px 0;
}

.compare-data {
  position: absolute;
  right: -215px;
  top: 0;
  width: 200px;
  margin: 0;
}

.result-img {
  margin-bottom: 10px;
}

.result-img > .img-container {
  width: 301px;
  height: 188px;
}

.car-data-container {
  display: flex;
  flex-direction: column;
  text-align: left;
  width: 100%;
}

.car-name {
  display: flex;
}

.car-name a {
  color: #434c56;
}

.car-name span {
  font-size: 1.3rem;
}

.car-name span.hide {
  display: none;
}

.filter-model-buttons {
  display: flex;
  margin-left: auto;
  flex-wrap: wrap;
}

.filter-model-buttons > .button {
  margin-top: 0;
  margin-bottom: 10px;
  margin-right: 0;
  margin-left: 5px;
  background-color: #ebf3f9;
  cursor: default;
}

.filter-model-buttons > .button > span {
  opacity: 0.5;
}

.car-data {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.car-data > div > p:first-child {
  opacity: 0.5;
  font-size: 0.875rem;
}

.car-data > div > p:nth-child(2), .change-data {
  margin-top: 5px;
}

.change-data {
  width: 90%;
  font-size: 0.875rem;
  padding-left: 0;
}

.change-data + .material-icons.expand {
  right: 10%;
  top: 30%;
}

.data-change-submit {
  margin-left: auto;
  cursor: pointer;
  border-radius: 3px;
  padding: 5px;
  color: var(--cpd-color);
  border: 1px solid var(--cpd-color);
}

.list-price {
  padding-top: 10px;
}

.further-data {
  display: flex;
  flex-wrap: wrap;
  margin-top: 10px;
}

.car-efficiency-class, .ncap-stars-container {
  margin-bottom: 10px;
}

.car-efficiency-class {
  display: flex;
  margin-top: auto;
  position: relative;
}

.car-efficiency-class > div {
  display: flex;
}

/*Efficiency class icons*/
.rectangle {
  width: 40px;
  height: 21px;
  color: white;
  font-size: 0.875rem;
  padding-left: 5px;
}

/*an equilateral triangle it’s worth pointing out that the height is 86.6% of the width so (border-left-width + border-right-width) * 0.866% = border-bottom-width*/
.arrow-right {
  width: 0; 
  height: 0; 
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
}

.rectangle.A-plus {
  background-color: #007000;
}

.arrow-right.A-plus {
  border-left: 10px solid#007000;
}

.rectangle.A {
  background-color: #009036;
}

.arrow-right.A {
  border-left: 10px solid#009036;
}

.rectangle.B {
  background-color: #58ab27;
}

.arrow-right.B {
  border-left: 10px solid#58ab27;
}

.rectangle.C {
  background-color: #b1c800;
}

.arrow-right.C {
  border-left: 10px solid#b1c800;
}

.rectangle.D {
  background-color: #ffec00;
}

.arrow-right.D {
  border-left: 10px solid#ffec00;
}

.rectangle.E {
  background-color: #fecc00;
}

.arrow-right.E {
  border-left: 10px solid#fecc00;
}

.rectangle.F {
  background-color: #f29400;
}

.arrow-right.F {
  border-left: 10px solid#f29400;
}

.rectangle.G {
  background-color: #e2001a;
}

.arrow-right.G {
  border-left: 10px solid#e2001a;
}

.material-icons.ncap-stars {
  color: #dfdfdf;
}

.material-icons.ncap-stars.active {
  color: yellow;
}

.ncap-stars-container {
  display: flex;
  margin-left: auto;
  margin-top: auto;
}

.ncap-stars {
  width: 100px;
  height: 16px;
  margin-left: 5px;
  margin-top: 3px;
}

div.popup {
  position: absolute;
  top: -50px;
  width: 200px;
  height: 25px;
  font-size: 0.75rem;
  background-color: white;
  padding: 6px;
  border: 1px solid #777;
  border-radius: 4px;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,.5);
  color: #5c5c5c;
  margin-top: 5px;
  margin-left: 5px;
  display: none;
}

.ncap-stars > div.popup {
  width: 145px;
}

div.popup > div {
  all: unset;
}

div.popup > div {
  position: absolute;
  width: 14px;
  background-color: white;
  height: 14px;
  top: 30px;
  transform: rotate(45deg);
  left: 25px;
  border-bottom: 1px solid #777;
  border-right: 1px solid #777;
}

.ncap-stars > p {
  opacity: 0.5;
  font-size: 0.875rem;
}

.model-compare-container {
  width: 5%;
  margin-top: 8px;
  margin-left: auto;
  margin-right: 145px;
  position: relative;
}

.model-compare-container > img {
  cursor: pointer;
  width: 40px;
}

.btn {
  width: 43%;
  padding-top: 8px;
  margin-top: auto;
}

.btn a {
  color: white;
  text-decoration: none;
  font-size: 0.875rem;
}

.btn a:hover {
  text-decoration: underline;
}

.btn.model-compare {
  display: flex;
  margin-right: auto;
  position: relative;
}

.btn.model-compare.add {
  background-color: orange;
}

.btn.model-compare.remove {
  background-color: orange;
}

.btn.model-compare > span {
  color: white;
  font-size: 0.875rem;
  margin-top: 5px;
  margin-left: auto;
  margin-right: 5px;
}

.btn.model-compare.remove > span {
  margin-top: 1px;
}

.btn.model-compare > p {
  font-size: 0.875rem;
  margin-right: auto;
}

.btn.model-compare:hover {
  background-color: #e69602;
}

.btn.model-compare:hover > p {
  text-decoration: underline;
}

.compare-popup {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 105px;
  left: 79.5%;
  border-radius: 4px;
  background-color: white;
  border: 1px solid lightgrey;
  width: 15%;
  min-height: 50px;
  padding: 20px;
}

.compare-popup.hide {
  opacity: 0;
  left: 85%;
}

.compare-car {
  margin-bottom: 15px;
  font-weight: bold;
  font-size: 1.25rem;
}

.compare-text {
  margin-bottom: 27px;
}

.compare-popup > .compare-models {
  margin-top: 20px;
  margin-bottom: 20px;
}

.compare-popup > .compare-models > p {
  position: relative;
  font-size: 0.875rem;
}

.compare-popup > .compare-models span.compare-model-bullet-point {
  font-size: 1rem;
}

.compare-popup .material-icons.close {
  position: absolute;
  right: 0;
}

.compare-popup .material-icons.close.hide, .compare-popup .compare-model-body.hide {
  display: none;
}

.compare-popup > .compare-models-button {
  margin-left: auto;
  margin-right: auto;
}

.compare-popup > .compare-models-button > a {
  display: block;
  background-color: var(--cpd-color);
  border: none;
  color: white;
  padding: 8px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 3px;
  cursor: pointer;
}

@media screen and (min-width: 30.0625em) {
  .result-header {
    margin: 0;
  }

  .btn.add-filter-mobile {
    display: none;
  }

  .result {
    display: flex;
    flex-direction: row;
    padding: 10px;
    margin: 13px 0;
  }

  .result-img {
    margin-bottom: 0;
  }

  .car-data {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }

  .further-data {
    display: grid;
    grid-template-columns: 10% 40% 25% 25%;
    margin-top: auto;
  }

  .car-efficiency-class, .ncap-stars-container {
    margin-bottom: 0;
  }

  .ncap-stars-container {
    margin-right: auto;
  }

  .ncap-stars {
    margin-left: 25px;
  }

  .btn {
    width: initial;
  }

  .btn.model-compare {
    margin-right: 10px;
  }
}