/* Prevent navbar from auto-scrolling to active item on page load */
.navbar-categories-row {
    justify-content: flex-start !important;
    scroll-behavior: auto !important;
}

/* Stop the active item from triggering scrollIntoView */
.navbar-categories-row .active,
.navbar-categories-row [aria-current],
.navbar-categories-row li.active a {
    scroll-margin: 0 !important;
    scroll-snap-align: none !important;
}

/* === Widget - Search Bar V 2.0 === */
.cgsearch-input {
  border: 1px solid #ccc;
  border-radius: 4px 0 0 4px;
  box-shadow: 1px 1px 29px -3px #fbfbfb;
  color: #222;
  flex-grow: 1;
  font-family: 'Hack', monospace;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  margin: 0;
  max-width: none;
  min-width: 0;
  padding: 0.375rem 0.75rem;
  position: static;
  transition: box-shadow 0.15s ease-in-out;
}

.cgsearch-input:focus {
  border-color: #4401FF;
  box-shadow: 0 0 8px rgba(68, 1, 255, 0.5);
  outline: none;
}

.cg-search-bar {
  align-items: center;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  margin: 20px auto;
  max-width: 700px;
  width: 100%;
}

.cg-search-bar button {
  background-color: #4401FF;
  border: 1px solid #ced4da;
  border-left: none;
  border-radius: 0 4px 4px 0;
  box-shadow: 1px 1px 29px -3px #fbfbfb;
  color: white;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.375rem 1rem;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

.cg-search-bar button:hover {
  background-color: #3200cc;
}

/* === Navbar Layout Fix V 2.0 === */
/* Keep only visual tweaks that don't conflict with cgstore.css */

.navbar {
  background: linear-gradient(0deg, #4401FF, #9606E6);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 0;
  width: 100%;
  position: sticky;
}

.navbar-brand {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  width: auto;
}

.navbar-brand img {
  height: 130px;
}

/* IMPORTANT: do NOT touch overflow or scrollbar on .navbar-categories;
   cgstore.css controls scrolling and scrollbar on .navbar-categories-row */

.navbar-categories {
  background: transparent !important;
  border: none !important;
  color: white;
  display: flex !important;
  flex-wrap: nowrap !important;
  font-family: 'Hack', monospace;
  font-weight: 600;
  margin: 0 0 0.1rem 0;
  padding: 0;
  white-space: nowrap;
  width: 100%;
}

/* removed:
   overflow-x: auto;
   scrollbar-width: none;
   scroll-behavior: smooth;
   and the ::-webkit-scrollbar { display:none; } rule
*/

.navbar-categories ul {
  display: flex;
  flex-wrap: nowrap;
  gap: 2rem;
  justify-content: flex-start;
  list-style: none;
  margin: 0;
  min-width: max-content;
  padding: 0 1rem;
  white-space: nowrap;
}

.navbar-categories li {
  display: inline-block;
  flex-shrink: 0;
  margin: 0 !important;
}

.navbar-categories a {
  border-radius: 4px;
  color: white;
  display: block;
  padding: 0.25rem 0.5rem;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.navbar-categories a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.navbar-categories-row {
  box-sizing: border-box;
  clear: both;
  display: flex !important;
  flex-direction: row !important;
  margin: 0px 0px 0rem 0px !important;
  order: 2;
  /* removed overflow-x and padding overrides so cgstore.css controls scroll + scrollbar */
  
}

.navbar-main-row {
  align-items: center;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  order: 1;
  width: 100%;
  padding: 0rem;
}

.navbar-nav {
  align-items: center;
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.navbar-nav .nav-link {
  color: white !important;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  white-space: nowrap;
}

.navbar-nav .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.navbar-nav-section {
  display: flex;
  flex-grow: 1;
  justify-content: flex-end;
  min-width: 0;
}

.navbar-search-form {
  align-items: center;
  background: #fff;
  border-radius: 4px;
  box-shadow: 1px 1px 29px -3px #fbfbfb;
  display: flex;
  flex-grow: 1;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
}

.navbar-search-form input[type="text"] {
  background: white;
  border: 1px solid #ced4da;
  border-radius: 0.25rem 0 0 0.25rem;
  flex-grow: 1;
  font-family: 'Hack', monospace;
  font-size: 1rem;
  min-width: 0;
  padding: 0.375rem 0.75rem;
}

.navbar-search-form button {
  background-color: rgba(255, 255, 255, 0.2);
  border: 1px solid #ced4da;
  border-left: none;
  border-radius: 0 0.25rem 0.25rem 0;
  color: white;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.375rem 1rem;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

.navbar-search-form button:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* === Dropdown Styling === */
.dropdown-menu {
  background-color: rgba(68, 1, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dropdown-menu .nav-link {
  color: white !important;
}

.dropdown-menu .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* === Responsive Adjustments === */
@media (max-width: 767px) {
  .navbar-main-row {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
  }

  .navbar-search-section {
    box-shadow: 1px 1px 29px -3px #fbfbfb;
    flex: 1;
    margin: 0 1rem;
    max-width: 100%;
  }

  .navbar-nav-section {
    flex: none;
    order: 2;
  }

  /* do NOT touch .navbar-categories-row padding/scrollbar here, cgstore.css does it */

  .navbar-categories ul {
    gap: 1rem;
    padding: 0 0.5rem;
  }

  .navbar-toggler {
    margin-left: auto;
    order: 2;
  }

  .navbar-search-form {
    display: none !important;
  }

  /* removed .navbar-categories::-webkit-scrollbar { display:none; } */
  .aimeos-magnify-search {
    display: block !important;
  }
}

@media (min-width: 768px) {
  .navbar-search-form {
    display: flex !important;
  }

  .aimeos-magnify-search {
    display: none !important;
  }

  .navbar-toggler {
    display: none;
  }
}

/* Dropdown styling (kept; matches above, harmless duplicate) */
.dropdown-menu {
  background-color: rgba(68, 1, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dropdown-menu .nav-link {
  color: white !important;
}

.dropdown-menu .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}
