/* CSS RESET */
* {
  list-style: none;
  margin: 0;
  padding: 0;
  text-decoration: none;
  font-weight: normal;
  font-size: 16px;
  box-sizing: border-box;
  color: var(--textColor);
}

.hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  color: black;
}

/* VARIABLES / COLORS*/

:root {
  --redAccent: #cf533a;
  --yellowAccent: #ffff5c;
  --textColor: #1f1f1f;
  --bg-color: #fafbee;
  --bg-color2: #dbe4e6;
}

/* COLORS FOR DARK MODE */
.dark-mode {
  --redAccent: #632418;
  --yellowAccent: #cccc00;
  --textColor: #fafbee;
  --bg-color: #1f1f1f;
  --bg-color2: #212d30;
}

/* HTML / BODY STYLES */
html,
body {
  min-height: 100%;
  min-width: 100%;
  height: 100%;
  font-size: 16px;
  font-family: "Inter", Arial, sans-serif;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
}

a {
  color: var(--yellowAccent);
}

h1,
h2,
h3,
button {
  font-family: "Crete Round", "Times New Roman", Times, serif;
  font-weight: bold;
}

/* HEADER STYLES */

header {
  background-color: var(--redAccent);

  position: sticky;
  top: 0;
  padding: 15px 10px;
}

header > div {
  display: flex;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
}

header h1 {
  font-size: 1.4rem;
  color: var(--yellowAccent);
}

nav {
  margin-left: auto;
}

nav ul {
  display: flex;
  align-items: center;
  gap: 10px;
}

nav a {
  font-size: 1.1rem;
}

nav a:hover {
  background-color: white;
}

header > div > button {
  margin-left: 10px;
  width: 60px;
  height: 30px;
  background-color: var(--bg-color);
  font-size: 1.1rem;
}

header > div > div {
  margin-left: 20px;
  position: relative;
}

header > div > div button {
  padding: 5px;
}

#item-count {
  position: absolute;
  font-weight: bold;
  bottom: -10px;
  left: -10px;
  font-size: 1.7rem;
  color: black;
}

/* MAIN STYLES */
main {
  width: 100%;
}
main > section > * {
  padding: 20px;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
}

h2 {
  font-size: 1.8rem;
  text-align: center;
}
/* ABOUT SECTION */

#about-section {
  background-color: var(--bg-color2);
}

.about-info {
  display: flex;
  flex-direction: column;
  margin: 20px auto 0;
  width: 90%;
}

.about-info h3 {
  font-size: 1.5rem;
  text-align: center;
  margin: 10px 0;
}

.about-info p {
  font-size: 1.1rem;
  line-height: 1.4;
  margin-bottom: 20px;
}

.about-info img {
  max-width: 300px;
  margin: 0 auto;
}

/* SHOPPING SECTION */

#shopping-section {
  background-color: var(--bg-color);
}

#shopping-section > h2 {
  margin-bottom: 20px;
}

#card-holder {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 20px;
}

.card {
  background-color: var(--redAccent);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 10px;
  box-shadow: 8px 9px 13px 0px rgba(0, 0, 0, 0.31);
}

.card img {
  border-radius: 5px;
}

.card p,
.card span {
  font-weight: bold;
}

.card p {
  padding: 10px;
}

.card h3 {
  font-size: 1.3rem;
  margin-top: 5px;
}

.card div {
  display: flex;
  gap: 20px;
  align-items: center;
}

.card label {
  font-weight: bold;
}

.card input {
  width: 50px;
}

.card button {
  padding: 5px;
  background-color: var(--yellowAccent);
  border: 2px solid white;
  outline: none;
}

/* COST CALCULATOR */

#cost-calculator {
  width: 100vw;
  height: 100%;
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  font-size: 1.9rem;
  display: flex;
  align-items: center;
}

#cost-calculator > div {
  margin: 0 auto;
  padding: 50px 20px 0;
  background-color: var(--redAccent);
  max-width: 475px;
  width: 60%;
  height: 45%;
  display: grid;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  line-height: 1.5;
}

#cost-calculator * {
  font-size: 1.2rem;
  font-weight: bold;
}

#cost-calculator button {
  background-color: var(--yellowAccent);
  padding: 10px;
}

#close-cart {
  position: absolute;
  right: 5px;
  top: 5px;
}

#check-out {
  margin-top: 20px;
}

/* CONTACT SECTION */

#contact-section {
  background-color: var(--bg-color2);
  display: flex;
  flex-direction: column;
}

#contact-section h2 {
  margin-bottom: 10px;
}

form {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 20px 0;
  margin: 0 auto;
}

form > div {
  display: flex;
  flex-direction: column;
}

label,
legend {
  font-weight: bold;
}

input,
fieldset,
textarea {
  border-radius: 5px;
  border: 3px solid black;
  color: black;
  font-family: "Inter", Arial, sans-serif;
}

fieldset {
  padding: 10px;
}

fieldset > div {
  padding: 5px;
}

input:user-invalid,
textarea:user-invalid {
  border: 3px solid var(--redAccent);
}

form button {
  max-width: 250px;
  width: 50%;
  margin: 20px auto 0;
  padding: 10px;
  border: 3px solid black;
  border-radius: 5px;
  color: var(--textColor);
  background-color: var(--bg-color);
}

button:hover {
  scale: 0.9;
  cursor: pointer;
}

/* FOOTER STYLES */

footer {
  background-color: var(--redAccent);
  text-align: center;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* MEDIA QUERIES */

@media (min-width: 600px) {
  .about-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr min-content;
    gap: 10px;
  }

  .about-info p {
    grid-column-start: 1;
  }

  .about-info:last-child img {
    grid-column-start: 1;
  }

  .about-info:last-child p {
    grid-column-start: 2;
    grid-row-start: 2;
  }

  .about-info:last-child h3 {
    grid-column-start: 2;
  }

  #card-holder {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1000px) {
  #card-holder {
    grid-template-rows: 1fr;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    max-width: 1200px;
  }
}
