:root {
  --marian-blue: #2b4677ff;
  --buff: #c9a390ff;
  --kobicha: #5b3e21ff;
  --desert-sand: #e2ba98ff;
  --dark-moss-green: #595921ff;
}
/* Buses Section */
#buses {
  background-image: url('../images/MainPage/1.jpg'); 
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
#buses::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5); 
  z-index: 0; 
}

#buses .container {
  position: absolute;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  height: 80%;
  background: #f5f5f5; 
  box-shadow: 0 30px 50px rgba(0, 0, 0, 0.2);
  border-radius: 20px;
  overflow: hidden;
  z-index: 1; /* Ensure it stays above the overlay */
}

/* Slide */
#buses .slide {
  position: relative;
  width: 100%;
  height: 100%;
  
}

/* Bus Items */
#buses .slide .item {
  width: 200px;
  height: 300px;
  position: absolute;
  top: 50%;
  transform: translate(0, -50%);
  border-radius: 20px;
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.2);
  background-position: 50% 50%;
  background-size: cover;
  display: inline-block;
  transition: 0.5s;
}

/* Positioning Bus Items */
#buses .slide .item:nth-child(1),
#buses .slide .item:nth-child(2) {
  top: 0;
  left: 0;
  transform: translate(0, 0);
  border-radius: 0;
  width: 100%;
  height: 100%;
}

#buses .slide .item:nth-child(3) {
  left: 70%;
}

#buses .slide .item:nth-child(4) {
  left: calc(70% + 220px);
}

#buses .slide .item:nth-child(5) {
  left: calc(70% + 440px);
}

#buses .slide .item:nth-child(n + 6) {
  left: calc(70% + 660px);
  opacity: 0;
  pointer-events: none;
}

/* Content within Bus Items */
#buses .item .content {
  position: absolute;
  top: 50%;
  left: 100px;
  width: 250px;
  text-align: left;
  color: rgba(241, 241, 245, 0.95);
  transform: translate(0, -50%);
  display: none;
  border-radius: 10px;
  padding: 20px;
  background-color: rgba(0, 0, 0, 0.3);
}

#buses .slide .item:nth-child(2) .content {
  display: block;
}

#buses .content .name {
  font-size: 40px;
  text-transform: uppercase;
  font-weight: bold;
  opacity: 0;
  animation: animate 1s ease-in-out 1s forwards;
}

/* Navigation Buttons */
#buses .button {
  width: 100%;
  text-align: center;
  position: absolute;
  bottom:10px; 
}

#buses .button button {
  width: 75px;
  height: 55px;
  margin: 10px; 
  font-size: 1.8rem;
  font-weight: bold;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 30px;
  position: relative;
  cursor: pointer;
}
.button-wrapper-buses {
  display: flex; 
  justify-content: flex-end; 
  width: 100%; 
}
#buses .button .nav-button-btn-kontakt,
#buses .button .nav-button-btn {
  width: 330px; 
  margin: 10px; 
  border: 2px solid #fff;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}
#buses .button button:hover {
  background: rgba(0, 4, 40, 0.95);
  color: #fff;
}


@media (min-width: 769px) and (max-width: 1440px) {
  /* Adjust navigation buttons */
  #buses .button button {
    font-size: 0.9rem;
    padding: 8px 16px;
  }

  /* Adjust bus switcher buttons */
  #buses .bus-switcher button {
    font-size: 0.8rem;
    padding: 8px 16px;
  }

  /* Show the bus-switcher-toggle button */
  #buses .bus-switcher-toggle {
    display: inline-block !important;
    color: #fff;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    align-items: center;
    border-radius: 30px;
    width: 100%; /* Full width for better UX */
    justify-content: center;
    transition: background 0.3s ease;
    display: flex; /* Ensure flex layout */
  }

  /* Hover effect for toggle button */
  #buses .bus-switcher-toggle:hover {
    background: linear-gradient(135deg, rgba(0, 4, 40, 0.85), rgba(0, 4, 40, 0.75));
  }


  /* Hide the bus-switcher-menu by default on mobile/tablet */
  #buses .bus-switcher-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%; 
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(0, 4, 40, 0.95), rgba(0, 4, 40, 0.85));
    padding: 10px 0;
    z-index: 1000;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
  }

  /* Show the bus-switcher-menu when active */
  #buses .bus-switcher.active .bus-switcher-menu {
    display: flex;
    max-height: 1000px; 
    opacity: 1;
  }

  /* Adjust bus buttons in the menu */
  #buses .bus-switcher-menu .bus-btn {
    width: 100%;
    margin: 5px 0;
    justify-content: flex-start;
    padding-left: 20px;
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
  }

  /* Active bus button styling */
  #buses .bus-switcher-menu .bus-btn.active {
    background: #003d80; /* Darker blue for active state */
  }

  /* Hover effect for bus buttons */
  #buses .bus-switcher-menu .bus-btn:hover {
    background: #0069d9;
    transform: scale(1.05);
  }


  /* Optional: Style navigation buttons (if re-enabled) */
  #buses .button {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
  }
 
  #buses .slide .item:nth-child(3) {
    left: 95%;
  }
  #buses .slide .item:nth-child(2) .content 
  {
    display: none !important;
  }
  #buses .slide .item:nth-child(4) .content 
  {
    display: none !important;
  }
}





@media (max-width: 768px) {
  #buses .slide {
    gap: 15px;
  }
  #buses .slide .item:nth-child(3) {
    left: 85%;
  }
  #buses .item {
    width: 45%;
    height: auto;
    aspect-ratio: 2 / 3;
  }

  #buses .content .name {
    font-size: 0.9rem;
  }

  #buses .slide .item:nth-child(2) .content 
  {
    display: none;
  }
}

@media (max-width: 480px) {
  #buses .item {
    width: 100%;
  }
  #buses .bus-switcher-menu .bus-btn{
    font-size: 0.7rem !important;
  }
   /* Show the bus-switcher-toggle button */
   #buses .bus-switcher-toggle {
    display: inline-block !important;
    color: #fff;
    border: none;
    font-size: 0.7rem;
    cursor: pointer;
    align-items: center;
    border-radius: 30px;
    width: 100%; /* Full width for better UX */
    justify-content: center;
    transition: background 0.3s ease;
    display: flex; /* Ensure flex layout */
  }

  #buses .button .nav-button-btn-kontakt, #buses .button .nav-button-btn
  {
    width: 100%;
  }
  .button-wrapper-buses {
    width: 0;
  }
#buses .slide .item:nth-child(3) {
  left: 90%;
}
#buses .button .prev,
  #buses .button .next {
    display: none; /* Ensure they are hidden */
  }
  #buses .button .nav-button-btn {
    display: none;
  }
}

/* Additional styling for bus switcher inside autokary section */
/* Bus Switcher */
#buses .bus-switcher {
  position: relative;
  text-align: center;
  border-radius: 5px; 
  background: linear-gradient(135deg, rgba(0, 4, 40, 0.95), rgba(0, 4, 40, 0.85));
  padding: 10px;
}

/* Bus Switcher Toggle Button */
#buses .bus-switcher-toggle {
  display: none; 
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

#buses .bus-switcher-toggle i {
  margin-right: 8px;
}


#buses .bus-switcher-menu {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  z-index: 2; 
}

#buses .bus-switcher-menu .bus-btn {
  display: inline-block;
  padding: 10px 20px;
  margin: 10px 5px;
  font-size: 1rem;
  font-weight: bold;
  color: #fff;
  text-transform: uppercase;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(0, 4, 40, 0.95), rgba(0, 4, 40, 0.85));
  transition: background-position 0.5s ease, transform 0.3s ease;
  border: 2px solid #fff;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
  cursor: pointer;
}

#buses .bus-switcher-menu .bus-btn i {
  margin-right: 8px;
}

#buses .bus-switcher-menu .bus-btn:hover {
  box-shadow: 0 0 40px rgba(255, 255, 255, 1); 
  transform: scale(1.1); 
}

/* Mobile Styles */
@media (max-width: 768px) {
  #buses .button button {
    font-size: 0.9rem;
    padding: 8px 16px;
  }

  /* Adjust bus switcher buttons */
  #buses .bus-switcher button {
    font-size: 0.8rem;
    padding: 8px 16px;
  }

  /* Show the bus-switcher-toggle button */
  #buses .bus-switcher-toggle {
    display: inline-block !important;
    color: #fff;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    align-items: center;
    border-radius: 30px;
    width: 100%; /* Full width for better UX */
    justify-content: center;
    transition: background 0.3s ease;
    display: flex; /* Ensure flex layout */
  }

  /* Hide the bus-switcher-menu by default on mobile/tablet */
  #buses .bus-switcher-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%; 
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(0, 4, 40, 0.95), rgba(0, 4, 40, 0.85));
    padding: 10px 0;
    z-index: 1000;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
  }

  /* Show the bus-switcher-menu when active */
  #buses .bus-switcher.active .bus-switcher-menu {
    display: flex;
    max-height: 1000px; 
    opacity: 1;
  }

  /* Adjust bus buttons in the menu */
  #buses .bus-switcher-menu .bus-btn {
    width: 100%;
    margin: 5px 0;
    justify-content: flex-start;
    padding-left: 20px;
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
  }

  /* Active bus button styling */
  #buses .bus-switcher-menu .bus-btn.active {
    background: #003d80; /* Darker blue for active state */
  }

  /* Hover effect for bus buttons */
  #buses .bus-switcher-menu .bus-btn:hover {
    background: #0069d9;
    transform: scale(1.05);
  }


  /* Optional: Style navigation buttons (if re-enabled) */
  #buses .button {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
  }

}

/* Animations */
@keyframes animate {
  from {
    opacity: 0;
    transform: translate(0, 100px);
    filter: blur(33px);
  }

  to {
    opacity: 1;
    transform: translate(0);
    filter: blur(0);
  }
}
