/* ---------------------------------------------------------------------
   Category toolbar
--------------------------------------------------------------------- */

.lm-cat-toolbar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 0;
}

@media (min-width: 768px) {
  .lm-cat-toolbar {
    padding: 24px 0 0;
  }
}

.lm-cat-toolbar__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  background: #f4f7fa;
  border: 1px solid rgba(10, 77, 140, 0.08);
  border-radius: 16px;
  padding: 14px 16px;
}

.lm-cat-search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 260px;
  min-width: 220px;
  background: #fff;
  border: 1.5px solid #d8e2ec;
  border-radius: 11px;
  padding: 11px 14px;
}

.lm-cat-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14.5px;
  color: #15212e;
  background: transparent;
  font-family: inherit;
}

.lm-cat-search input::placeholder {
  color: #9aabba;
}

.lm-cat-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lm-cat-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #5b7185;
  font-weight: 500;
}

.lm-cat-sort select {
  border: 1.5px solid #d8e2ec;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: #15212e;
  background: #fff;
  outline: none;
  cursor: pointer;
  font-family: inherit;
}

.lm-cat-view-toggle {
  display: flex;
  background: #fff;
  border: 1.5px solid #d8e2ec;
  border-radius: 10px;
  overflow: hidden;
}

.lm-cat-view-btn {
  padding: 9px 12px;
  border: none;
  cursor: pointer;
  background: #fff;
  color: #8aa0b3;
  display: flex;
  align-items: center;
  transition:
    background 0.15s,
    color 0.15s;
}

.lm-cat-view-btn.is-active {
  background: #0a4d8c;
  color: #fff;
}

.lm-cat-count {
  padding: 16px 4px 0;
  font-size: 13.5px;
  color: #8aa0b3;
  font-weight: 300;
  margin: 0;
}

.lm-cat-count span {
  color: #0a4d8c;
  font-weight: 600;
}
/* ---------------------------------------------------------------------
   List view header + rows (only visible when data-view="list")
--------------------------------------------------------------------- */

.lm-cat-list-header,
.lm-view-list {
  display: none;
}

.lm-cat-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.lm-cat-grid[data-view='grid'] {
  padding: 24px 20px 64px;
}

@media (min-width: 768px) {
  .lm-cat-grid[data-view='grid'] {
    padding: 24px 0 64px;
  }
}
.lm-cat-grid[data-view='list'] {
  display: block;
  border: 1px solid rgba(10, 77, 140, 0.1);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 50px;
  margin-top: 15px;
  overflow-x: auto;
}

.lm-cat-grid[data-view='list'] .lm-cat-list-header,
.lm-cat-grid[data-view='list'] .lm-view-list {
  display: grid;
}

.lm-cat-grid[data-view='list'] .lm-view-grid {
  display: none;
}

.lm-cat-list-header,
.lm-cat-list-row {
  grid-template-columns: 110px 2.6fr 1fr 0.9fr 158px;
  gap: 16px;
  align-items: center;
  padding: 16px 22px;

  min-width: 700px; /* force the rows to a minimum width so they overflow and trigger the scroll on narrow containers */
}

.lm-cat-list-header {
  background: #f4f7fa;
  border-bottom: 1px solid rgba(10, 77, 140, 0.1);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5b7185;
}

.lm-cat-list-header__right {
  text-align: right;
}

.lm-cat-list-row {
  border-bottom: 1px solid #eef2f6;
  transition: background 0.13s;
}

.lm-cat-list-row:hover {
  background: #f9fbfd;
}

.lm-cat-list-row__sku {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 13px;
  font-weight: 600;
  color: #0a4d8c;
}

.lm-cat-list-row__product {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  text-decoration: none;
}

.lm-cat-list-row__thumb {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  background-color: #e3edf6;
  border: 1px solid rgba(10, 77, 140, 0.08);
}

.lm-cat-list-row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lm-cat-list-row__text {
  min-width: 0;
}

.lm-cat-list-row__title {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  color: #15212e;
  line-height: 1.3;
}

.lm-cat-list-row__desc {
  display: block;
  font-size: 12.5px;
  color: #8aa0b3;
  font-weight: 300;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lm-cat-list-row__size,
.lm-cat-list-row__pack {
  font-size: 13.5px;
  color: #3a4d5e;
}

.lm-cat-list-row__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.lm-cat-list-row__quote {
  text-decoration: none;
  cursor: pointer;
  text-align: center;
  background: #eef4fa;
  color: #0a4d8c;
  font-size: 13px;
  border: 1px solid #eef4fa;
  font-weight: 600;
  padding: 9px 12px;
  width: 100%;
  border-radius: 9px;
  transition: background 0.15s;
}

.lm-cat-list-row__btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #0a4d8c;
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s,
    transform 0.15s;
}

.lm-cat-list-row__btn:hover {
  transform: scale(1.06);
}

/* Grid view: still visible normally, hidden in list mode (handled above) */
.lm-cat-grid[data-view='grid'] .lm-cat-list-header,
.lm-cat-grid[data-view='grid'] .lm-view-list {
  display: none;
}

/* ---------------------------------------------------------------------
   Modal
--------------------------------------------------------------------- */

.lm-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 130;
  background: rgba(3, 42, 82, 0.5);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 5vh, 64px) 18px;
  overflow-y: auto;
}

.lm-modal-overlay[hidden] {
  display: none;
}

.lm-modal {
  width: 100%;
  max-width: 820px;
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 50px 100px -40px rgba(3, 42, 82, 0.6);
  animation: lmDrawer 0.22s ease;
  max-height: calc(100svh - 160px);
  overflow: auto;
}

@keyframes lmDrawer {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.lm-modal__top {
  display: flex;
  flex-wrap: wrap;
}

.lm-modal__image {
  position: relative;
  flex: 1 1 260px;
  min-height: 240px;
  background-color: #e3edf6;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(10, 77, 140, 0.1) 0,
    rgba(10, 77, 140, 0.1) 1.5px,
    transparent 1.5px,
    transparent 10px
  );
}

.lm-modal__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.lm-modal__info {
  flex: 1 1 320px;
  min-width: 280px;
  padding: clamp(24px, 3vw, 34px);
  position: relative;
}

.lm-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f4f7fa;
  border: none;
  cursor: pointer;
  color: #5b7185;
  font-size: 16px;
}

.lm-modal__title {
  margin: 0 34px 8px 0;
  font-weight: 700;
  font-size: clamp(21px, 2.5vw, 27px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #15212e;
}

.lm-modal__desc {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.5;
  color: #8aa0b3;
  font-weight: 300;
}

.lm-modal__specs {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}

.lm-modal__spec-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8aa0b3;
  margin-bottom: 3px;
}

.lm-modal__spec-value {
  font-size: 14.5px;
  font-weight: 600;
  color: #15212e;
}

.lm-modal__cta {
  text-decoration: none;
  display: block;
  text-align: center;
  background: #0a4d8c;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 14px;
  border-radius: 11px;
  box-shadow: 0 14px 30px -14px rgba(10, 77, 140, 0.6);
  transition:
    transform 0.18s,
    background 0.18s;
}

.lm-modal__bottom {
  border-top: 1px solid #eef2f6;
  padding: clamp(20px, 2.6vw, 30px) clamp(24px, 3vw, 34px);
}

.lm-modal__tabs {
  display: inline-flex;
  background: #f4f7fa;
  border-radius: 11px;
  padding: 5px;
  margin-bottom: 22px;
}

.lm-modal__tab {
  border: none;
  cursor: pointer;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  background: transparent;
  color: #5b7185;
  transition: 0.15s;
}

.lm-modal__tab.is-active {
  background: #0a4d8c;
  color: #fff;
}

.lm-modal__related-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 768px) {
  .lm-modal__related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.lm-modal__panel p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.75;
  color: #3a4d5e;
  font-weight: 300;
  display: grid;
}

.lm-modal__related-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
  border: 1px solid rgba(10, 77, 140, 0.1);
  border-radius: 13px;
  cursor: pointer;
  transition:
    background 0.13s,
    border-color 0.13s;
}

.lm-modal__related-item:hover {
  background: #f9fbfd;
  border-color: rgba(10, 77, 140, 0.22);
}

.lm-modal__related-item + .lm-modal__related-item {
  margin-top: 8px;
}

.lm-modal__related-thumb {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  background-color: #e3edf6;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(10, 77, 140, 0.1) 0,
    rgba(10, 77, 140, 0.1) 1.5px,
    transparent 1.5px,
    transparent 7px
  );
  border: 1px solid rgba(10, 77, 140, 0.08);
}

.lm-modal__related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lm-modal__related-text {
  min-width: 0;
}

.lm-modal__related-name {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: #15212e;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lm-modal__related-sku {
  display: block;
  font-size: 12.5px;
  font-weight: 400;
  color: #8aa0b3;
  margin-top: 2px;
}

.lm-product-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(10, 77, 140, 0.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 30px -22px rgba(3, 42, 82, 0.3);
  transition:
    transform 0.22s,
    box-shadow 0.22s;
}

.lm-product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px -18px rgba(3, 42, 82, 0.4);
}

.lm-product-card__image {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background-color: #e3edf6;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(10, 77, 140, 0.09) 0,
    rgba(10, 77, 140, 0.09) 1.5px,
    transparent 1.5px,
    transparent 10px
  );
  overflow: hidden;
}

.lm-product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lm-product-card__code {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
  color: #0a4d8c;
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 9px;
  border-radius: 6px;
}

.lm-product-card__body {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.lm-product-card__link {
  text-decoration: none;
  display: block;
  flex: 1;
}

.lm-product-card__title {
  margin: 0 0 5px;
  font-weight: 600;
  font-size: 15.5px;
  color: #15212e;
  line-height: 1.3;
}

.lm-product-card__desc {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 1.55;
  color: #8aa0b3;
  font-weight: 300;
}

.lm-product-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.lm-product-card__tag {
  font-size: 11.5px;
  color: #3a4d5e;
  background: #f4f7fa;
  padding: 4px 9px;
  border-radius: 100px;
}

.lm-product-card__footer {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.lm-product-card__quote {
  text-decoration: none;
  flex: 1;
  text-align: center;
  background: #eef4fa;
  color: #0a4d8c;
  font-size: 13px;
  font-weight: 600;
  padding: 11px;
  border-radius: 9px;
  transition: background 0.15s;
}

.lm-product-card__quote:hover {
  background: #dfeaf5;
}

.lm-product-card__btn {
  flex-shrink: 0;
  width: 42px;
  border-radius: 9px;
  background: #0a4d8c;
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.lm-product-card__btn:hover {
  background: #003a70;
}
