/* Full-page wait indicator for slow navigations (search). */
#loading {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10001;
  background: rgba(238, 238, 238, 0.75);
}

/* Reserve space for above-the-fold elements so the mobile header and product grid do not shift. */
.top-header .logo {
  width: 88px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}

#catalog_items:empty {
  min-height: 600px;
}

/* width/height attrs are for CLS only. height:auto + width=150 on tall/narrow
   PNG thumbnails (e.g. 59×150) was stretching them to ~380px tall. */
.catalog-item-image {
  overflow: hidden;
}

#catalog_items .catalog-item-image img,
.related-products img[width][height],
.related-product img {
  max-width: 100%;
  max-height: 150px;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 767px) {
  .top-header > .container > .row {
    min-height: 72px;
  }

  .top-header .logo {
    margin-top: 8px;
    width: 56px;
  }
}

@media (max-width: 380px) {
  .logo-text {
    display: none;
  }
}

/* Mobile category order without JS moves: headings, sort/stock controls, filter button, products, long text.
   Avoid display:contents — it breaks MagicZoom absolute positioning and spills full-size images over the grid. */
@media (max-width: 1199px) {
  .category-layout {
    display: flex;
    flex-direction: column;
    margin-left: 0;
    margin-right: 0;
  }

  .category-layout > .category-main {
    order: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .category-layout > .category-filters {
    order: 3;
    padding-left: 0;
    padding-right: 0;
  }

  .category-main > .compare-notice,
  .category-main > .catalog-filter {
    order: 2;
  }

  .category-main > #catalog_items {
    order: 4;
  }

  .category-main > .well {
    order: 5;
  }
}

/* Catalog card price block and guest wholesale notice.
   Caption was fixed at 250px — wholesale block + stock overflowed into Add to Cart. */
.catalog-item .caption {
  height: auto;
  min-height: 0;
  padding-bottom: 4px;
}

.catalog-item .item-buttons {
  position: relative;
  z-index: 2;
  margin-top: 6px;
  min-height: 34px;
}

.catalog-item .caption .item-price {
  text-align: center;
  font-size: 12px;
  color: #000;
  margin-bottom: 5px;
}

.catalog-item .caption .item-price strong {
  display: block;
  font-size: 16px;
}

.catalog-item .caption .item-name a {
  color: #000;
}

.wholesale-price-notice {
  margin: 0 0 10px;
}

.wholesale-price-notice__text {
  font-size: 13px;
  margin-bottom: 6px;
}

.wholesale-price-notice__actions .btn {
  margin: 0 4px 4px 0;
  white-space: normal;
}

.wholesale-price-notice--compact {
  margin: 0 0 6px;
}

.wholesale-price-notice--compact .wholesale-price-notice__text {
  font-size: 10px;
  line-height: 1.25;
  margin-bottom: 4px;
}

.wholesale-price-notice--compact .wholesale-price-notice__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.wholesale-price-notice--compact .wholesale-price-notice__actions .btn {
  display: inline-block;
  width: auto;
  margin: 0;
  padding: 2px 6px;
  font-size: 10px;
  white-space: nowrap;
}

.product-specs th {
  width: 35%;
}

.related-product {
  text-align: center;
  margin-bottom: 15px;
}

.related-product span {
  display: block;
  font-size: 12px;
  color: #000;
}
