/* Products catalog page — new design */

/* Legacy utility classes not bundled in new-design CSS */
.nd-layout .displaynon {
  display: none !important;
}

/* Bootstrap modals: hidden until JS opens them (legacy main.css + bootstrap provided this) */
.nd-layout .modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1050;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}

.nd-layout .modal.show {
  display: block;
}

.nd-layout .modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background-color: rgba(0, 0, 0, 0.5);
}

.nd-layout .modal-backdrop.show {
  display: block;
}

.nd-layout .modal:not(.show) .modal-dialog {
  pointer-events: none;
}

.page.nd-products {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 18px 48px;
}

.nd-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  color: var(--blue-800);
  font-size: 13px;
  font-weight: 800;
}

.nd-breadcrumb a {
  color: var(--blue-800);
  text-decoration: none;
}

.nd-breadcrumb a:hover {
  text-decoration: underline;
}

.nd-breadcrumb-sep {
  color: var(--muted);
  font-weight: 700;
}

.nd-breadcrumb [aria-current="page"] {
  color: var(--blue-950);
}

.nd-products-shell {
  width: 100%;
}

/* Model-group accordion headers (e.g. "Conduit and Raceway - +") are not used in new design */
.nd-products .nd-model-group-head {
  display: none !important;
}

.nd-products #menu_product_list_block {
  float: none !important;
  width: 100%;
}

.nd-products #menu_product_list_block > .AllProducts.promo-grid,
.nd-products #menu_product_list_block > .AllProducts.nd-product-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 16px;
  width: 100%;
  float: none !important;
  flex-wrap: unset !important;
}

/* Legacy model wrappers should not split the grid into separate rows */
.nd-products #menu_product_list_block > .model-parent-list {
  display: contents;
}

.nd-products #menu_product_list_block .model-parent-list .AllProducts.promo-grid,
.nd-products #menu_product_list_block .model-parent-list .AllProducts.nd-product-grid {
  display: contents;
}

.nd-products #menu_product_list_block [id^="model_block_"] {
  display: contents;
  margin: 0 !important;
  float: none !important;
}

.nd-products #menu_product_list_block .ProductBlock,
.nd-products #menu_product_list_block .nd-product-card-wrap {
  width: auto !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  float: none !important;
}

.nd-products #menu_product_list_block .nd-product-card-wrap .product-card {
  height: 100%;
}

.nd-products-shell .upper_search_block .search_radio {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 18px;
}

.nd-products-shell .form-check-inline {
  margin: 0;
}

.nd-products-shell .form-check-label {
  color: var(--blue-950);
  font-weight: 700;
  font-size: 14px;
}

.nd-products-shell .custom_btn,
.nd-products-shell .load-more-data.kgtloadmore,
.nd-products-shell #product_catagory_next,
.nd-products-shell .actn-btn {
  border-radius: 999px;
}

.nd-layout .nd-products-shell #more_button_home_product_list.load-more-data.kgtloadmore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 160px;
  max-width: 100%;
  margin: 16px auto;
  padding: 10px 24px;
  background: var(--blue-900) !important;
  color: var(--white) !important;
  border: 1px solid var(--blue-900) !important;
  box-shadow: none !important;
  font-weight: 700;
}

.nd-layout .nd-products-shell.is-loading-products #more_button_home_product_list,
.nd-layout .nd-products-shell #more_button_home_product_list.is-loading {
  display: none !important;
}

.nd-products-shell .prod_sort {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
}

.nd-products-shell .prod_sort label {
  color: var(--blue-950);
  font-weight: 800;
  font-size: 14px;
}

.nd-products-shell .prod_sort-select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  background: var(--white);
  color: var(--blue-950);
}

.nd-products-shell .filter-list .AllProducts:not(.promo-grid) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 16px;
}

.nd-products-shell .filter-list .ProductBlock {
  width: auto;
  margin: 0 !important;
  float: none;
}

.nd-product-grid,
.nd-products .promo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 16px;
}

.nd-product-card-wrap {
  width: auto !important;
  margin: 0 !important;
  float: none !important;
}

.nd-product-card-wrap .product-card {
  min-height: 100%;
}

.nd-product-card-wrap h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  float: none !important;
  width: auto !important;
  clear: none !important;
  max-width: 100%;
}

.nd-product-card-wrap h3 a {
  color: var(--blue-950);
  text-decoration: none;
}

.nd-product-card-wrap .product-actions {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.nd-product-card-wrap .add-button {
  text-align: center;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}

.nd-product-card-wrap .add-cart-grey {
  opacity: 0.72;
  pointer-events: none;
}

.nd-product-sku {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.nd-product-more-link {
  display: inline-flex;
  justify-content: center;
  color: var(--blue-800);
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
}

.promo-ribbon--muted {
  background: rgba(107, 114, 128, 0.14);
  color: var(--muted);
}

.nd-model-group-head {
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--blue-950);
  font-weight: 800;
}

.nd-products-loading {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1200;
  place-items: center;
  background: rgba(7, 29, 58, 0.28);
}

/* jQuery .show() sets display:block inline — preserve centered grid overlay */
#loading.nd-products-loading[style*="display: block"],
#loading.nd-products-loading[style*="display:block"] {
  display: grid !important;
}

#loading.nd-products-loading {
  opacity: 1 !important;
  background: rgba(7, 29, 58, 0.28) !important;
}

#loading.nd-products-loading .loadingContent,
#loading.nd-products-loading > img,
#loading.nd-products-loading > p {
  display: none !important;
}

.nd-products-loading__panel {
  background: var(--white);
  border-radius: 18px;
  padding: 24px 28px;
  box-shadow: 0 18px 40px rgba(7, 29, 58, 0.18);
  text-align: center;
  min-width: 120px;
}

.nd-products-loading__spinner {
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border: 3px solid rgba(15, 59, 120, 0.16);
  border-top-color: var(--blue-900);
  border-radius: 50%;
  animation: nd-products-loading-spin 0.7s linear infinite;
}

.nd-products-loading__text {
  margin: 0;
  color: var(--blue-950);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  position: static !important;
  width: auto !important;
  background: transparent !important;
  padding: 0 !important;
}

.nd-products-loading__text:empty {
  display: none;
}

@keyframes nd-products-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.product-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(7, 29, 58, 0.07);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.promo-card .product-image.promo-card__visual {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  min-height: 200px;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
}

.promo-card .product-image.promo-card__visual--photo {
  display: block;
  background: #ffffff;
}

.promo-card__media {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  box-sizing: border-box;
  background: #ffffff;
}

.promo-card .promo-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.promo-card__category {
  max-width: calc(100% - 32px);
  text-align: center;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: var(--blue-900);
  font-weight: 900;
  text-transform: uppercase;
}

.product-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.product-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

.promo-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: rgba(255, 199, 44, 0.16);
  color: var(--yellow-deep);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

.promo-card__description {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.promo-price {
  color: var(--red);
  font-weight: 900;
  font-size: 15px;
}

.add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--blue-900);
  color: var(--white);
  font-weight: 900;
  font-size: 14px;
}

@media (min-width: 1024px) {
  .nd-products #menu_product_list_block > .AllProducts.promo-grid,
  .nd-products #menu_product_list_block > .AllProducts.nd-product-grid,
  .nd-product-grid,
  .nd-products .promo-grid,
  .nd-products-shell .filter-list .AllProducts:not(.promo-grid) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.nd-product-card-wrap .product-image.example-image-link {
  cursor: zoom-in;
}

/* Product image lightbox (estore-light.js — styles normally in main.css) */
#lightboxOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  z-index: 10050;
}

#lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10060;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-box {
  position: relative;
}

.lb-img {
  display: block;
  max-width: 90vw;
  max-height: 90vh;
  transition: opacity 0.2s ease;
}

.lb-loader {
  position: absolute;
  top: 50% !important;
  left: 50% !important;
  width: 50px !important;
  height: 50px !important;
  margin: -25px 0 0 -25px !important;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #fff;
  border-radius: 50%;
  animation: nd-lightbox-spin 0.7s linear infinite;
  z-index: 10062;
}

@keyframes nd-lightbox-spin {
  to {
    transform: rotate(360deg);
  }
}

.lb-close {
  position: absolute;
  top: 2px;
  right: 0;
  width: 30px;
  height: 30px;
  cursor: pointer;
  z-index: 10063;
  background: url("../../../frontend/images/close.png") top right no-repeat;
}

.lb-close:hover {
  opacity: 0.7;
}

.lb-prev,
.lb-next {
  position: absolute;
  top: 50%;
  width: 45px;
  height: 45px;
  margin-top: -22px;
  cursor: pointer;
}

.lb-prev {
  left: -60px;
}

.lb-next {
  right: -60px;
}

.lb-prev::after,
.lb-next::after {
  content: "";
  position: absolute;
  top: 15px;
  width: 14px;
  height: 14px;
  border-top: 2px solid #fff;
  border-right: 2px solid #fff;
}

.lb-prev::after {
  left: 15px;
  transform: rotate(-135deg);
}

.lb-next::after {
  right: 15px;
  transform: rotate(45deg);
}

@media (max-width: 720px) {
  .page.nd-products {
    padding-top: 22px;
    padding-bottom: 36px;
  }

  .nd-products-shell .upper_search_block .search_radio {
    gap: 8px 12px;
  }

  .nd-products-shell .prod_sort {
    flex-wrap: wrap;
  }
}

/* Taxonomy-filtered product listing (category, brand, model, etc.) */
.nd-taxonomy-products .nd-taxonomy-products-list {
  margin-top: 8px;
}

.nd-taxonomy-products .nd-taxonomy-products-list .section-title {
  margin-bottom: 0;
}

.nd-taxonomy-products .nd-load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.nd-taxonomy-products .nd-load-more-wrap .load-more-data {
  border: 0;
  cursor: pointer;
}

.nd-taxonomy-products #menu_product_list_block .prod_sort {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
}

.nd-taxonomy-products #menu_product_list_block .prod_sort label {
  color: var(--blue-950);
  font-weight: 800;
  font-size: 14px;
  margin: 0;
}

.nd-taxonomy-products #menu_product_list_block .prod_sort-select-cat {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  background: var(--white);
  color: var(--blue-950);
}

/* Legacy main.css: h3 { float:left; width:100% }, .AllProducts { display:flex }, .ProductBlock { width:25% } */
.nd-layout .nd-products-shell.car-lists,
.nd-layout .nd-products-shell.productbaselisting {
  float: none !important;
  width: 100% !important;
}

.nd-layout .nd-product-card-wrap .product-body,
.nd-layout .nd-product-card-wrap .product-body p,
.nd-layout .nd-product-card-wrap .product-meta,
.nd-layout .nd-product-card-wrap .product-actions {
  float: none !important;
  width: auto !important;
  clear: none !important;
  max-width: 100%;
}

.nd-layout .nd-products #menu_product_list_block .ProductBlock.nd-product-card-wrap {
  width: auto !important;
  max-width: none !important;
  padding: 0 !important;
}

@media (max-width: 1023px) {
  .nd-layout .nd-products #menu_product_list_block > .AllProducts.promo-grid,
  .nd-layout .nd-products #menu_product_list_block > .AllProducts.nd-product-grid,
  .nd-layout .nd-product-grid,
  .nd-layout .nd-products .promo-grid,
  .nd-layout .nd-products-shell .filter-list .AllProducts:not(.promo-grid) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 650px) {
  .page.nd-products {
    padding-top: 18px;
    padding-bottom: 32px;
  }

  .nd-layout .nd-products #menu_product_list_block > .AllProducts.promo-grid,
  .nd-layout .nd-products #menu_product_list_block > .AllProducts.nd-product-grid,
  .nd-layout .nd-product-grid,
  .nd-layout .nd-products .promo-grid,
  .nd-layout .nd-products-shell .filter-list .AllProducts:not(.promo-grid) {
    grid-template-columns: 1fr !important;
  }

  .nd-layout .nd-products #menu_product_list_block .ProductBlock,
  .nd-layout .nd-products #menu_product_list_block .nd-product-card-wrap {
    width: 100% !important;
    max-width: 100% !important;
  }

  .nd-layout .nd-product-card-wrap .product-actions {
    grid-template-columns: 1fr;
  }

  .nd-layout .nd-product-card-wrap .add-button {
    width: 100% !important;
  }

  .nd-layout .nd-product-more-link {
    min-height: 44px;
    align-items: center;
  }

  .nd-layout .nd-products-shell .prod_sort {
    flex-direction: column;
    align-items: stretch;
  }

  .nd-layout .nd-products-shell .prod_sort-select {
    width: 100%;
    min-width: 0;
  }
}

/* Products listing pagination (new design) */
.nd-products-pagination {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.nd-products-pagination__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}

.nd-products-pagination__total {
  margin: 0;
  color: var(--blue-950);
  font-size: 15px;
  font-weight: 800;
}

.nd-products-pagination__per-page {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue-800);
  font-size: 13px;
  font-weight: 700;
}

.nd-products-pagination__per-page-select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  background: var(--white);
  color: var(--blue-950);
  font-weight: 700;
}

.nd-products-pagination__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.nd-products-pagination__btn {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--blue-900);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.nd-products-pagination__btn:hover:not(:disabled) {
  background: var(--blue-50);
}

.nd-products-pagination__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.nd-products-pagination__pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.nd-products-pagination__page {
  min-width: 40px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--blue-900);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.nd-products-pagination__page.is-active {
  background: var(--blue-900);
  border-color: var(--blue-900);
  color: var(--white);
}

.nd-products-pagination__ellipsis {
  color: var(--muted);
  font-weight: 800;
  padding: 0 4px;
}

@media (max-width: 650px) {
  .nd-products-pagination__nav {
    flex-direction: column;
    align-items: stretch;
  }

  .nd-products-pagination__btn {
    width: 100%;
  }

  .nd-products-pagination__pages {
    order: -1;
  }
}
