/*
 * Marketplace styles ported from the Rails app (app/assets/stylesheets).
 * Bootstrap itself comes from the CDN in the layout.
 */

body.marketplace-body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f4f4f4;
}

.marketplace-top {
  background: #c40018;
  color: #fff;
  padding: 8px 15px;
  font-size: 13px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.marketplace-domains {
  margin-left: auto;
  font-weight: normal;
  color: #ffd9dd;
}

.marketplace-menu-toggle {
  background: none;
  border: 0;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.marketplace-brand {
  background: #002d86;
  text-align: center;
  padding: 14px 10px 16px;
}

.marketplace-logo {
  max-width: 350px;
  width: 80%;
  height: auto;
}

.marketplace-shell {
  display: block;
}

.marketplace-content {
  min-height: 100vh;
}

.marketplace-menu {
  display: none;
  background: #fff;
  padding: 15px;
  border-top: 1px solid #ccc;
}

.marketplace-menu.is-open {
  display: block;
}

.marketplace-menu a {
  display: block;
  padding: 10px;
  text-decoration: none;
  color: #333;
  border-bottom: 1px solid #eee;
}

.marketplace-menu a:hover {
  color: #c40018;
}

.marketplace-menu a.marketplace-menu-link.is-active:not(.marketplace-menu-search) {
  color: #c40018;
  font-weight: bold;
  background: #fff5f6;
  border-left: 3px solid #c40018;
  padding-left: 7px;
}

.marketplace-menu .marketplace-menu-search {
  background: #c40018;
  color: #fff;
  border-bottom: 0;
  border-radius: 6px;
  margin-bottom: 8px;
  font-weight: bold;
  text-align: center;
}

.marketplace-menu .marketplace-menu-search:hover {
  color: #fff;
  filter: brightness(1.1);
}

.marketplace-menu .marketplace-menu-search.is-active {
  box-shadow: inset 0 0 0 3px #fff;
}

.marketplace-menu-heading {
  padding: 14px 10px 6px;
  color: #c40018;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.marketplace-menu a:last-child {
  border-bottom: 0;
}

.marketplace-menu .marketplace-menu-logout {
  color: #c40018;
  font-weight: bold;
}

.marketplace-logout-form {
  margin: 0;
}

.marketplace-logout-form button {
  display: block;
  width: 100%;
  padding: 10px;
  text-align: left;
  background: none;
  border: 0;
  border-top: 1px solid #eee;
  font: inherit;
  cursor: pointer;
}

.marketplace-logout-form button:hover {
  color: #c40018;
}

/* Signed-in members get a persistent sidebar in place of the hamburger. */
@media (min-width: 901px) {
  .marketplace-member .marketplace-menu-toggle {
    display: none;
  }

  .marketplace-member .marketplace-shell {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 0;
  }

  .marketplace-member .marketplace-menu {
    display: block;
    position: sticky;
    top: 1.5rem;
    flex: 0 0 240px;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  }

  .marketplace-member .marketplace-content {
    flex: 1 1 auto;
    min-width: 0;
  }
}

@media (max-width: 800px) {
  .marketplace-domains {
    display: none;
  }

  .marketplace-logo {
    max-width: 300px;
  }
}

.marketplace-footer {
  margin-top: 2rem;
  padding: 1.5rem 1rem 2rem;
  text-align: center;
  border-top: 1px solid #ddd;
}

.marketplace-footer-links a {
  color: #002d86;
  font-weight: bold;
  text-decoration: none;
  margin: 0 4px;
}

.marketplace-footer-links a:hover {
  text-decoration: underline;
}

.marketplace-footer-note {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #6c757d;
}

.btn-primary {
  background-color: #002d86;
  border-color: #002d86;
}

.btn-primary:hover {
  background-color: #001f5e;
  border-color: #001f5e;
}

.search-results-cards {
  display: none;
}

@media (max-width: 767px) {
  .search-results-table {
    display: none;
  }

  .search-results-cards {
    display: block;
  }
}

/* Mobile card images keep a consistent size without server-side crops. */
.search-results-cards .card-img-top {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

table.sortable thead th {
  cursor: pointer;
  white-space: nowrap;
}

table.sortable thead th::after {
  content: "";
  display: inline-block;
  margin-left: 6px;
  border: 4px solid transparent;
}

table.sortable thead th[data-sort-dir="asc"]::after {
  border-bottom-color: #6c757d;
  transform: translateY(-2px);
}

table.sortable thead th[data-sort-dir="desc"]::after {
  border-top-color: #6c757d;
  transform: translateY(2px);
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.current-image {
  max-width: 100px;
  max-height: 100px;
}

.carousel-item img {
  max-height: 70vh;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
