/* ================================================
   Navbar
=================================================== */

.navbar {
  position: fixed;
  width: 100%;
  z-index: 1000;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  transition: top 0.3s ease-in-out, background-color 0.3s ease,
    padding 0.3s ease;
  margin: auto;
  backdrop-filter: blur(2px);
  background: rgba(36, 82, 53, 0.1);
}

.navbar.hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.navbar.visible {
  opacity: 1;
  visibility: visible;
}

.container-fluid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: auto;
}

.navbar-container {
  width: 90%;
  margin: 0 auto;
  z-index: 2;
}

.scrolled {
  background-color: var(--crisal-green-light) !important;
  transition: background-color 0.3s ease;
  height: 17vh;
}


/* ================================================
   Logo Styling
=================================================== */
.fixed-logo {
  position: relative;
  display: block;
  margin-right: auto;
  overflow: hidden;
  align-items: center;
  height: auto;
  width: auto;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.navbar-brand img {
  height: 16vh;
  width: auto;
  display: block;
  margin: auto 0;
}

.navbar.scrolled .navbar-brand img {
  height: 10vh;
  transition: height 0.3s ease;
}

.navbar.scrolled {
  min-height: 12vh;
}



/* ================================================
   Dropdown Menu
=================================================== */
.dropdown-menu {
  color: white !important;
  background-color: rgba(152, 152, 152, 0.5);
}

.dropdown-item {
  color: white !important;
  background-color: transparent !important;
  font-size: var(--font-lg);
  /* 16px */
}

.dropdown-item:hover {
  color: var(--crisal-green) !important;
}

/* Remove dropdown arrow */
.navbar-nav .dropdown-toggle::after {
  display: none !important;
}

.toggle-size {
  font-size: var(--font-lg);
  /* 16px */
  padding: 0.5rem 1rem;
}

.dropdown-submenu {
  position: absolute;
  left: -100%;
  top: 0;
  margin-top: 0;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.2s, opacity 0.2s;
}

.dropstart:hover>.dropdown-submenu,
.dropstart:focus-within>.dropdown-submenu {
  visibility: visible;
  opacity: 1;
}

.dropdown-menu li {
  position: relative;
}

.dropdown-toggle.dropdown-item::after {
  display: inline-block;
  margin-left: 0.5em;
  vertical-align: 0.25em;
  border-top: 0.3em solid transparent;
  border-right: 0;
  border-bottom: 0.3em solid transparent;
  border-left: 0.3em solid;
  content: "";
}

.dropstart {
  position: relative;
}

.dropstart>.dropdown-menu {
  top: 0;
  right: 100%;
  left: auto;
  margin-left: 0;
  display: none;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.3s, opacity 0.3s;
  position: absolute;
  z-index: 1050;
}

.dropstart:hover>.dropdown-menu {
  display: block;
  visibility: visible;
  opacity: 1;
}


/* ================================================
   Menu and Utilities
=================================================== */
.navbar-custom,
.navbar-nav,
.toggle-size,
.nav-utilities {
  display: flex;
  align-items: center;
}

.navbar-custom {
  margin-right: 2rem;
}

.nav-utilities {
  gap: 10px;
  padding: 0rem 0rem;
  border-radius: 4px;
}

.custom-select-wrapper {
  position: relative;
  top: 2px;
  display: inline-block;
  width: 80%;
  /* ou auto/ajustado */
  cursor: pointer;
}

.custom-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: transparent;
  border: none;
  color: white;
  padding: 0.375rem 1.6rem 0.6rem 0.375rem;
  /* espaço para seta direita */
  width: 100%;
  cursor: pointer;
  font-size: var(--font-lg);
}

/* For Safari - remove inner arrow */
.custom-select::-ms-expand {
  display: none;
}

/* Custom icon */
.custom-select-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
}

.custom-select option {
  background-color: black;
  color: white;
}



/* ================================================
   Search Bar */
.search-icon {
  cursor: pointer;
  padding: 0.5rem 0rem 0.5rem 0.5rem;
}

.fullscreen-search {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.664);
  z-index: 1050;
  display: none;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
  padding: 2rem;
}

.fullscreen-search.active {
  display: flex;
}

.search-input-container {
  position: relative;
  width: 100%;
}

.search-submit-btn {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #555;
  cursor: pointer;
  padding: 0;
}

.search-center {
  width: 100%;
  max-width: 600px;
}

.big-search-input {
  font-size: 2rem;
  padding-right: 4rem;
  border: 1px solid #ccc;
  border-radius: 10px;
  width: 100%;
}

.big-search-input:focus {
  outline: none !important;
  border-color: var(--crisal-green-light) !important;
  box-shadow: 0 0 0 5px var(--crisal-green-light) !important;
}

.close-search {
  position: absolute;
  top: 20px;
  right: 30px;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--crisal-green-light);
}


/* ================================================
   Responsive Design
=================================================== */

@media (max-width: 576px) {
  .navbar {
    height: 13vh;
    max-height: 13vh;
    overflow: visible;
    /* importante: dropdown pode expandir para fora */
    display: flex;
    align-items: center;
    padding: 0 1rem;
    z-index: 1000;
    box-sizing: border-box;
  }

  .navbar.scrolled {
    height: 11vh;
    max-height: 11vh;
    transition: background-color 0.3s ease;
    align-items: center;
  }

  .navbar-container {
    width: 100%;
    padding: 0;
    box-sizing: border-box;
  }

  .container-fluid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
  }

  .fixed-logo {
    display: flex;
    align-items: center;
    height: 100%;
    max-height: 100%;
    margin-right: auto;
    padding: 0;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
  }

  .navbar-brand img {
    max-height: 10vh;
    height: auto;
    width: auto;
    display: block;
    object-fit: contain;
  }

  .navbar.scrolled .navbar-brand img {
    max-height: 8vh;
    height: auto;
    padding-top: 0;
    padding-bottom: 0;
    transition: height 0.3s ease;
  }

  .navbar-custom,
  .nav-utilities {
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  .dropdown-menu .dropdown-item {
    padding: 0.6rem 1rem;
    margin: 0;
    font-size: 1.5rem;
  }

  .dropdown-menu .dropdown-menu {
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  .dropdown-menu .dropdown-menu+.dropdown-item,
  .dropstart+li>.dropdown-item {
    margin-top: 0.5rem !important;
  }

  .dropdown-menu .dropdown-menu .dropdown-item:last-child {
    margin-bottom: 0.5rem;
  }

  .dropdown-menu .dropdown-menu.show {
    padding: 0;
    margin: 0.25rem 0 0.5rem 0;
    background-color: rgba(0, 0, 0, 0.3) !important;
  }

  /* Indentation for nested submenu items */
  .dropdown-menu .dropdown-menu .dropdown-item {
    padding-left: 2rem;
    font-size: 1.3rem;
  }

  /* Force dropdown submenu toggle icon to point down */
  .dropstart .dropdown-toggle::before {
    display: none !important;
  }

  .dropstart .dropdown-toggle::after {
    content: "";
    display: inline-block !important;
    margin-left: 0.5em;
    vertical-align: 0.2em;
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
    transform: rotate(0deg) !important;
  }

  .dropstart .dropdown-menu {
    top: 100% !important;
    left: 0 !important;
    margin-top: 0.125rem !important;
    margin-left: 0 !important;
  }

  .dropdown-menu .dropdown-toggle::after,
  .dropstart .dropdown-toggle::after {
    transform: rotate(0deg) !important;
  }

  .dropdown-menu {
    display: none;
  }

  .dropdown-menu.show {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95) !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 4rem;
    z-index: 2000;
    overflow-y: auto;
  }

  .dropdown-menu .dropdown-item {
    padding: 1rem;
    text-align: center;
    width: 100%;
  }

  .dropdown-menu .dropdown-item:hover {
    color: var(--crisal-green) !important;
  }

  .dropdown-menu .dropdown-menu {
    position: static !important;
    background-color: transparent !important;
    box-shadow: none;
    display: none;
    padding: 0;
  }

  .dropdown-menu .dropdown-menu.show {
    display: flex !important;
    flex-direction: column;
    align-items: center;
  }

  .btn-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 3000;
  }

  .dropdown.dropstart>.dropdown-toggle::after {
    transform: rotate(0deg) !important;
    margin-left: 0.5rem;

  }

}

@media (min-width: 576px) and (max-width: 992px) {
  .navbar {
    max-height: 20vh;
    height: 20vh;
    overflow: visible;
    display: flex;
    align-items: center;
    /* centro vertical */
    box-sizing: border-box;
    padding: 0rem;
  }

  .navbar-container {
    width: 90%;
    padding: 0;
    box-sizing: border-box;
  }

  .container-fluid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* centro vertical */
    flex-wrap: nowrap;
    width: 90%;
    height: 100%;
    box-sizing: border-box;
  }

  .fixed-logo {
    display: flex;
    align-items: center;
    height: 100%;
    max-height: 100%;
    margin-right: auto;
    padding: 0;
    margin-top: 1rem;
    margin-bottom: 1rem;
  }

  .navbar-brand img {
    max-height: 12vh;
    height: auto;
    width: auto;
    display: block;
    object-fit: contain;
  }

  .navbar.scrolled .navbar-brand img {
    max-height: 12vh;
    padding-top: 0;
    padding-bottom: 0;
  }

  .navbar.scrolled {
    height: 20vh;
    max-height: 20vh;
    align-items: center;
  }

  .navbar-custom,
  .nav-utilities {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    overflow: hidden;
  }


  .navbar-container {
    width: 100%;
  }

  .dropdown-menu .dropdown-item {
    padding: 0.6rem 1rem;
    margin: 0;
    font-size: 1.5rem;
  }

  .dropdown-menu .dropdown-menu {
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  .dropdown-menu .dropdown-menu+.dropdown-item,
  .dropstart+li>.dropdown-item {
    margin-top: 0.5rem !important;
  }

  .dropdown-menu .dropdown-menu .dropdown-item:last-child {
    margin-bottom: 0.5rem;
  }

  .dropdown-menu .dropdown-menu.show {
    padding: 0;
    margin: 0.25rem 0 0.5rem 0;
    background-color: rgba(0, 0, 0, 0.3) !important;
  }

  /* Indentation for nested submenu items */
  .dropdown-menu .dropdown-menu .dropdown-item {
    padding-left: 2rem;
    font-size: 1.3rem;
  }

  /* Force dropdown submenu toggle icon to point down */
  .dropstart .dropdown-toggle::before {
    display: none !important;
  }

  .dropstart .dropdown-toggle::after {
    content: "";
    display: inline-block !important;
    margin-left: 0.5em;
    vertical-align: 0.2em;
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
    transform: rotate(0deg) !important;
  }

  .dropstart .dropdown-menu {
    top: 100% !important;
    left: 0 !important;
    margin-top: 0.125rem !important;
    margin-left: 0 !important;
  }

  .dropdown-menu .dropdown-toggle::after,
  .dropstart .dropdown-toggle::after {
    transform: rotate(0deg) !important;
  }

  .dropdown-menu {
    display: none;
  }

  .dropdown-menu.show {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95) !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 4rem;
    z-index: 2000;
    overflow-y: auto;
  }

  .dropdown-menu .dropdown-item {
    padding: 1rem;
    text-align: center;
    width: 100%;
  }

  .dropdown-menu .dropdown-item:hover {
    color: var(--crisal-green) !important;
  }

  .dropdown-menu .dropdown-menu {
    position: static !important;
    background-color: transparent !important;
    box-shadow: none;
    display: none;
    padding: 0;
  }

  .dropdown-menu .dropdown-menu.show {
    display: flex !important;
    flex-direction: column;
    align-items: center;
  }

  .btn-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 3000;
  }

  .dropdown.dropstart>.dropdown-toggle::after {
    transform: rotate(0deg) !important;
    margin-left: 0.5rem;
    vertical-align: middle;
  }
}

@media (min-width: 992px) {
  .navbar-nav .dropdown:hover>.dropdown-menu {
    display: block;
    margin-top: 0;
  }

  .dropdown-menu .dropdown:hover>.dropdown-menu {
    display: block;
    left: 100%;
    top: 0;
    margin-top: 0;
  }
}