/* Search suggest dropdown */
.search-container {
  position: relative;
}
.search-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e9eff7;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  z-index: 100000;
  max-height: 420px;
  overflow: auto;
}
.search-suggest.hidden {
  display: none;
}
.search-suggest ul {
  list-style: none;
  margin: 0;
  padding: 6px;
}
.search-suggest li {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}
.search-suggest li:hover,
.search-suggest li.is-active {
  background: #f4f7ff;
}
.search-suggest li img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border: 1px solid #eef2fb;
  border-radius: 8px;
  background: #fff;
}
.search-suggest .ss-title {
  color: #2b2b2b;
  font-weight: 600;
}
.search-suggest .ss-price {
  color: #22549f;
  font-weight: 700;
}

/* Product Modal */
.product-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  z-index: 999999;
}
.product-modal.is-open {
  display: grid;
  place-items: center;
}
.pm-dialog {
  width: min(900px, 92vw);
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  border: 1px solid #e9eef7;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  max-height: 90vh;
  overflow: auto;
}
.pm-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.pm-title {
  font-family: "League Spartan";
  font-weight: 800;
  font-size: 1.6rem;
  color: #2b2b2b;
  margin: 0;
}
.pm-close {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}
.pm-body {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
}
.pm-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100%;
}
.pm-img {
  width: 100%;
  height: 280px;
  object-fit: contain;
  border: 1px solid #ebeff7;
  border-radius: 12px;
  background: #fff;
}
.pm-price .now {
  font-size: 1.6rem;
  font-weight: 800;
  color: #2b2b2b;
}
.pm-price .was {
  color: #9aa6c5;
  text-decoration: line-through;
  margin-left: 8px;
}
.pm-desc {
  color: #4d5363;
  margin-top: 6px;
}
.pm-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: auto;
  justify-content: space-between;
  width: 100%;
  padding-top: 10px;
}
.pm-actions .pc-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid #dfe5f2;
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}
.pm-actions .pc-qty button {
  width: 40px;
  height: 40px;
  border: none;
  background: #f2f5ff;
  color: #1f2f56;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}
.pm-actions .pc-qty button:hover {
  background: #e2e9ff;
}
.pm-actions .pc-qty input {
  width: 64px;
  border: none;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  outline: none;
  background: transparent;
  color: #1f2f56;
}
.pm-actions .pc-add {
  position: static;
  border: none;
  background: #22549f;
  font-family: "Afacad";
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem 1.8rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}
.pm-actions .pc-add:hover {
  background: #183a6d;
}
.pm-actions .pc-add:disabled {
  opacity: 0.7;
  cursor: wait;
}
.pm-crumbs{
  color: #183a6d;
}
.pm-crumbs a{
  text-decoration: none;
  color: #183a6d;
}
.pm-crumbs a:hover{
  text-decoration: underline;
}

@media (max-width: 770px) {
  .search-suggest {
    position: absolute; /* sidri se na stranicu, skupa se miče sa search barom */
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    max-width: 100vw;
    top: 69px; /* JS dinamički postavi točno ispod inputa */
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    z-index: 999999999999999999999999;
    max-height: 40vh;
    overflow: auto; /* scroll unutar suggesta */
  }
}
@media (max-width: 703px) {
  /* where we mount the search bar under the user-assets-bar */
  #mobileSearchMount {
    display: block;
    position: fixed;
    top: 6rem; /* equals .user-assets-bar height */
    left: 0;
    right: 0;
    padding: 0;
    z-index: 999999999999999999999999; /* as requested */
  }
  #mobileSearchMount .search-container {
    left: 0%;
    width: 100%;
    height: 44px;
    border-radius: 0;
  }

  /* keep the suggest dropdown usable on mobile */
  #mobileSearchMount .search-suggest {
    position: absolute; /* sidri se na stranicu, skupa se miče sa search barom */
    left: 50%;
    transform: translateX(-51%);
    width: 102vw;
    max-width: 102vw;
    top: 54px; /* JS dinamički postavi točno ispod inputa */
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    z-index: 999999999999999999999999;
    max-height: 40vh;
    overflow: auto; /* scroll unutar suggesta */
  }
}
@media (max-width: 700px) {
  .pm-body {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 500px) {
  .user-pages a img {
    width: 27px;
  }
  .user-assets {
    width: 80%;
    padding-left: 1em;
  }
  .search-bar {
    width: 0;
  }
  .user-pages {
    width: 45vw;
    padding-right: 1em;
  }
  .logo img {
    height: 4em;
  }
}

@media (max-width: 440px) {
  #mobileSearchMount .search-container {
    height: 30px;
  }
  .search-input {
    height: 20px;
  }
  #mobileSearchMount .search-suggest {
    top: 40px;
  }
  .search-button:hover {
    transform: none;
  }
  .search-button {
    font-size: 7px;
  }
}

@media (max-width: 381px) {
  .pm-body {
    grid-template-columns: 1fr;
  }
  #mobileSearchMount {
    top: 5rem;
  }
}
