/* stylesheet for abonnement bestilling */

/* ---------- ikke klassificeret ---------- */

/* wrapper */
.wrapper {
  padding: 0 20px;
  max-width: 805px;
  margin: 0 auto;
  margin-bottom: 130px;
  margin-top: 40px;
}

/* ---------- article med alt indholdet (grid) ---------- */

/* article med alt indholdet */
article {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: repeat(5, auto);
  grid-template-areas:
    "h1 h1"
    "form sidebar"
    "form sidebar"
    "form sidebar"
    "bottombar bottombar";
  column-gap: 20px;
}

/* hovedoverskriften */
article h1 {
  grid-area: h1;
  margin-bottom: 20px;
  text-align: center;
  font-size: 3.5em;
}

/* */
form {
  grid-area: form;
}

/* ---------- formularen og dens egenskabet ---------- */

/* formularen */
form {
  box-sizing: border-box;
  padding: 60px 35px;
  max-width: 540px;
  height: 500px;
  background-color: #eeeeee;
  display: grid;
  grid-template-columns: auto 2fr;
  grid-template-rows: repeat(12, minmax(0, 25px));
  column-gap: 30px;
  row-gap: 10px;
  overflow: hidden;
}

/* font-awesome ikoner i formularen */
form i {
  color: #e30613;
  font-size: 0.8em;
  margin-left: 1em;
  margin-right: 1em;
}

/* labels i formularen top/1-8 */
label:nth-of-type(-n + 8) {
  grid-column: 1/2;
  text-align: right;
  font-size: 12px;
  line-height: 20px;
}

input {
  grid-column: 2/3;
  border: none;
  height: 23px;
  padding: 0 6px;
  width: 98%;
}

input:focus {
  outline: 1px solid #e30613;
}

.checkbox input:focus {
  outline: unset;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  box-shadow: 0 0 0 30px white inset !important;
}

/* de 3 checkbox'es */
.checkbox {
  grid-column: 2/3;
  display: flex;
  gap: 10px;
}

/* rykker 3 checkbox på linje med text */
.checkbox input {
  margin-top: -5px;
  width: unset;
}

/* placere de 3 checkbox i deres korrekte felt i formular griddet */
.checkbox {
  grid-row: 10/10;
}

#checkbox2 {
  grid-row: 11/11;
}

#checkbox3 {
  grid-row: 12/12;
}

/* checkbox label styling */
.checkbox label {
  text-align: left;
  font-size: 0.625em;
  line-height: 1em;
}

/* ---------- valgte produkt, pris og næste inkl. table ---------- */

/* section indenholder alt */
section {
  background-color: #eeeeee;
  height: 360px;
  box-sizing: border-box;
  padding: 20px;
}

/* h2'er i sectionen*/
section h2 {
  font-size: 1.125em;
  margin-bottom: 1em;
}

/* p i sectionen */
section p {
  font-size: 0.625em;
  margin-bottom: 1em;
}

/* rykker sidste p ned */
section p:last-of-type {
  margin-top: 3em;
}

/* ----- alt med table inden i sectionen ----- */

/* kollapser tablen */
table {
  border-collapse: collapse;
}

/* får table til at fylde det hele */
table tr th {
  width: 100%;
  padding: 10px 0;
}

/* rykker tekst og pris til hver sin side */
table tr th:first-of-type {
  text-align: left;
}

table tr th:last-of-type {
  text-align: right;
}

/* tilføjer de sorte borders */
table tr {
  border-bottom: 1px solid #000;
}

table tr:first-of-type {
  border-top: 1px solid #000;
}

/* så kun pris i alt er bold */
table tr:nth-child(-n + 2) th {
  font-weight: 200;
}

/* ----- alt med knappen på sidebaren ----- */

.flex-sidebarbutton {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.flex-sidebarbutton button {
  text-align: center;
  align-self: end;
  width: 75%;
  border: none;
  border-radius: 5px;
  padding: 13px 20px;
  background-color: #e30613;
  font-size: 1.125em;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.flex-sidebarbutton button:active {
  background-color: #bd0713;
}

/* ---------- bottom baren ---------- */

/* bottom bar div */
.bottom-bar {
  grid-area: bottombar;
  margin-top: 50px;
  padding: 10px;
  text-align: center;
  background-color: #eeeeee;
}

/* knappen (skriv til os) */
.bottom-bar button {
  width: 160px;
  border: none;
  border-radius: 5px;
  margin: 15px 0 10px 0;
  padding: 10px;
  background-color: #e30613;
  font-size: 1.125em;
  color: #fff;
  cursor: pointer;
}

/* ændre farve onclick */
.bottom-bar button:active {
  background-color: #bd0713;
}

/* error message */
form p {
  position: relative;
  background-color: #ad4848;
  color: #fff;
  border-radius: 5px;
  font-size: 0.75em;
  padding: 5px;
  width: 150px;
  right: -20px;
  top: 10px;
  display: none;
}

#bestil div p::after {
  /* triangle */
  content: "";
  position: absolute;
  left: 22px;
  bottom: 100%;
  height: 0;
  width: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #ad4848;
}

/* ---------- media queries ---------- */
@media only screen and (max-width: 860px) {
  .wrapper {
    padding-top: 60px;
    margin-top: 0;
  }
  article h1 {
    padding-top: 40px;
    font-size: 2.5em;
  }
}

@media only screen and (max-width: 720px) {
  article {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas: unset;
    grid-template-areas:
      "h1"
      "form"
      "sidebar"
      "bottombar";
  }
  form {
    max-width: 100%;
    margin-bottom: 2em;
  }
  .flex-sidebarbutton button {
    margin-top: 1.5em;
    width: 100%;
  }
  .flex-sidebarbutton {
    margin-bottom: 2em;
  }
}

@media only screen and (max-width: 500px) {
  .checkbox {
    grid-column: 1/3;
    display: flex;
    gap: 10px;
  }
  /* labels i formularen top/1-8 */
  label:nth-of-type(-n + 8) {
    grid-column: 1/3;
    text-align: left;
    align-self: end;
    margin-bottom: -5px;
  }

  /* inputs i formularen top/1-8 */
  input:nth-of-type(-n + 8) {
    grid-column: 1/3;
    border: none;
    height: 30px;
  }
  form {
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(20, minmax(0, 25px));
    column-gap: 0px;
  }
  .checkbox {
    grid-row: 18/18;
    margin-bottom: 8px;
  }

  #checkbox2 {
    grid-row: 19/19;
    margin-bottom: 7px;
  }

  #checkbox3 {
    grid-row: 20/20;
    margin-bottom: 16px;
  }
}

@media only screen and (max-width: 420px) {
  .wrapper {
    padding-top: 0;
  }
}
