/* ===== MAIN LAYOUT ===== */
main {
  display: flex;
  flex-direction: row;
  align-content: space-around;
  width: 80%;
  justify-self: center;
}

/* ===== MENU SECTION ===== */
.menu {
  display: flex;
  flex-direction: column;
}

#ons_menu {
  font-size: 4.25rem;
  width: fit-content;
  padding-top: 2rem;
  align-self: center;
}

#bestsellers {
  display: flex;
  flex-direction: column;
  gap: 1rem 0;
  padding-bottom: 3.25rem;
}

.sectionNaam {
  font-size: 3.25rem;
  position: relative;
  left: 2rem;
}

.listItem {
  display: flex;
  justify-content: space-around;
  align-content: space-around;
  flex-wrap: wrap;
  gap: 3rem 0;
}

/* ===== CARD COMPONENTS ===== */
.card,
aside {
  background-color: #f9f3e7;
  border-radius: var(--border-radius-large);
  box-shadow: 5px 8px 7px rgba(0, 0, 0, 0.2);
}

.card {
  display: flex;
  flex-direction: column;
  min-width: 16rem;
}

.card img {
  margin: 1rem 1rem 0 1rem;
  align-self: center;
  max-width: 12rem;
  border-radius: var(--border-radius-large);
}

.card h1 {
  align-self: center;
  font-size: 2.1rem;
  padding: 0.5rem;
}

.card h2 {
  align-self: center;
  font-size: 1rem;
}

.card p,
.card h1,
.card h2 {
  height: fit-content;
  text-align: left;
  padding-left: 0.3rem;
}

.card button {
  margin: 1rem 0;
  border-radius: 20rem;
}

.card ul {
  margin: 0.8rem 0;
  display: flex;
  flex-direction: column;
}

.card ul div {
  display: flex;
  justify-content: space-between;
}

.card afmeetingPizza,
.card .prijsPizza {
  margin: 0 0.4rem;
}

.card ul p {
  font-size: 1rem;
  color: var(--color-grey-dark);
}

.card form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* ===== SIDEBAR (ORDER SUMMARY) ===== */
aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;

  min-height: 25rem;
  min-width: 20rem;
  height: fit-content;
  padding: 2rem;

  position: sticky;
  top: var(--spacing-medium);

  margin-top: 8rem;
  margin-left: 1rem;
  margin-right: 1rem;
}

aside h2 {
  font-size: 1.5rem;
}

.pizzalist {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  width: 100%;
}

/* Nieuwe container voor naam en prijs op één lijn */
.pizza-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 0.5rem;
}

/* Container voor aantal en verwijderknop */
.pizza-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: solid black 2px;
  margin-top: var(--spacing-medium);
}

/* Aanpassingen voor de form elements */
.pizza-controls form {
  margin: 0;
  display: flex;
  align-items: center;
}

.pizza-controls select {
  padding: 4px 8px;
  border-radius: var(--border-radius-small);
  border: 1px solid #ccc;
}

.close-aside,
.aside-toggle,
.aside-overlay {
  display: none;
}

.order-list {
  max-height: 400px; /* Pas hoogte aan naar wens */
  overflow-y: auto;
  margin-bottom: 1rem;
}

.order-list {
  max-height: 250px;
  overflow-y: auto;
  
  /* Fix voor horizontale scroll: */
  overflow-x: hidden;
}

/* Of specifieker: */
.order-list::-webkit-scrollbar {
  width: 8px;
}

.order-list::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.order-list::-webkit-scrollbar-thumb {
  background: var(--primary-color);
}

.order-list {
  scrollbar-width: thin; /* voor Firefox */
  scrollbar-color: var(--primary-color) #f1f1f1;
}

/* ===== BUTTON STYLES ===== */
.remove-button,
.bestelButton {
  background-color: var(--primary-color);
  color: var(--color-light-bg);
  border: none;
  border-radius: var(--border-radius-small);
  cursor: pointer;
  text-decoration: none;
}

.bestelButton {
  padding: 8px 12px;
  margin-top: 10px;
}

.remove-button {
  padding: 8px 12px;
  margin-top: 5px;
}

.orderbutton {
  background-color: var(--primary-color);
  color: var(--color-light-bg);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  text-decoration: none;
  width: 35px;
  height: 35px;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== MEDIA QUERIES ===== */
@media (max-width: 1430px) {
  main {
    width: 100%;
  }
  .listItem {
    gap: 3rem;
  }
}

@media (max-width: 1165px) {
  .listItem {
    gap: 1rem;
  }
}

@media (max-width: 1100px) {  
  main {
    flex-direction: column;
    padding-bottom: 100px;
    width: 100%;
    overflow-x: hidden;
    position: relative;
  }

  main aside {
    display: none;
    position: fixed;
    bottom: 1vh;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 70vw;
    max-height: 60vh;
    z-index: 1000;
    margin: 0;
    padding: 1.5rem;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.3);
    background-color: #f9f3e7;
    border-radius: var(--border-radius-large);
    border: solid var(--primary-color);
  }

  main aside.show {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .close-aside {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-color);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .close-aside:hover {
    background-color: rgba(0, 0, 0, 0.1);
  }

  .aside-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: none;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
  }

  .aside-toggle:hover {
    background-color: var(--color-green-dark);
    transform: scale(1.1);
  }

  .aside-toggle:active {
    transform: scale(0.95);
  }

  .cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
  }

  main .menu {
    order: 1;
    width: 100%;
  }

  .aside-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
  }

  .aside-overlay.show {
    display: block;
  }

  .order-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 1rem;
  }

  .pizzalist {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .pizza-header {
    flex-wrap: nowrap;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .pizza-controls {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .close-aside {
    display: flex;
  }

  .aside-toggle {
    display: flex;
  }
}

@media (max-width: 530px) {
  .listItem {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
  
  .card {
    min-width: auto;
    width: calc(50% - 0.5rem);
    max-width: 14rem;
  }
  
  .card img {
    max-width: 8rem;
  }
  
  .card h1 {
    font-size: 1.8rem;
  }
}

@media (max-width: 475px) {
  .card img {
    max-width: 8rem;
  }
}