/* E-shop catalogue and product layout — 0.2.244 */

body.page-category,
body.page-product {
  --oc-shop-sidebar-width: 248px;
  --oc-shop-gap: 24px;
  --oc-card-border: #d8d8d8;
  --oc-card-muted: #555;
  --oc-card-stock: #24a83e;
}

/* The old right-hand column is empty on the catalogue and only wastes space. */
body.page-category #right-column {
  display: none !important;
}

@media (min-width: 768px) {
  body.page-category #left-column {
    flex: 0 0 var(--oc-shop-sidebar-width) !important;
    width: var(--oc-shop-sidebar-width) !important;
    max-width: var(--oc-shop-sidebar-width) !important;
  }

  body.page-category #content-wrapper {
    flex: 1 1 0 !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  body.page-category #left-column > .oc-shop-nav {
    position: sticky;
    top: 14px;
  }
}

/* Category navigation follows the compact typography of the former shop. */
body.page-category .oc-shop-nav,
body.page-product .oc-shop-nav {
  width: 100%;
  max-width: var(--oc-shop-sidebar-width);
  color: #0d0d0d;
}

body.page-category .oc-shop-nav-heading,
body.page-product .oc-shop-nav-heading {
  min-height: 54px;
  padding-right: 15px;
  padding-left: 15px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

body.page-category .oc-shop-main-link,
body.page-product .oc-shop-main-link {
  padding: 12px 7px 12px 20px;
  color: #0d0d0d !important;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

body.page-category .oc-shop-category-row,
body.page-product .oc-shop-category-row {
  min-height: 48px;
}

body.page-category .oc-shop-category:not(:last-child)::after,
body.page-product .oc-shop-category:not(:last-child)::after {
  right: 15px;
  left: 15px;
}

/* Four cards on desktop, two on tablet and two on phones. */
body.page-category #js-product-list .products-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
  gap: 20px !important;
  margin: 0 !important;
}

body.page-category #js-product-list .products-grid > .js-product-miniature-wrapper {
  display: flex !important;
  flex: 0 0 calc((100% - 60px) / 4) !important;
  width: calc((100% - 60px) / 4) !important;
  max-width: calc((100% - 60px) / 4) !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible;
}

body.page-category #js-product-list .products-grid > .js-product-miniature-wrapper > .product-miniature,
body.page-category #js-product-list .products-grid > .product-miniature {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid var(--oc-card-border);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .13);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

body.page-category #js-product-list .products-grid > .js-product-miniature-wrapper > .product-miniature:hover,
body.page-category #js-product-list .products-grid > .js-product-miniature-wrapper > .product-miniature:focus-within,
body.page-category #js-product-list .products-grid > .product-miniature:hover,
body.page-category #js-product-list .products-grid > .product-miniature:focus-within {
  border-color: #bcbcbc;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .15);
  transform: translateY(-2px);
}

body.page-category .product-miniature .thumbnail-container {
  display: flex !important;
  flex: 0 0 auto;
  flex-direction: column;
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  margin: 0 !important;
  background: #fff !important;
}

body.page-category .product-miniature .product-thumbnail {
  display: flex !important;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  margin: 8px 8px 0;
  overflow: hidden;
  background: #fff;
}

body.page-category .product-miniature .product-thumbnail picture {
  display: contents;
}

body.page-category .product-miniature .product-thumbnail img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
  object-fit: contain !important;
}

/* The theme already renders the correct last-item badge, but hides it in listings. */
body.page-category .product-miniature.oc-card-last-item .thumbnail-container {
  position: relative !important;
}

body.page-category .product-miniature.oc-card-last-item .product-availability {
  position: absolute !important;
  z-index: 8;
  top: 12px;
  right: auto !important;
  bottom: auto !important;
  left: 12px;
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: calc(100% - 24px);
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  pointer-events: none;
}

body.page-category .product-miniature.oc-card-last-item .product-last-items {
  display: inline-flex !important;
  align-items: center;
  max-width: 100%;
  margin: 0 !important;
  padding: 6px 9px !important;
  border: 0 !important;
  border-radius: 2px;
  background: #ef7f45 !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .16);
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  text-align: left;
  white-space: normal;
}

body.page-category .product-miniature .product-description {
  position: static !important;
  display: flex !important;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100% !important;
  height: auto !important;
  padding: 13px 14px 0 !important;
  background: #fff !important;
  text-align: left !important;
}

body.page-category .product-miniature .product-category-name,
body.page-category .product-miniature .product-reference,
body.page-category .product-miniature .product-add-cart,
body.page-category .product-miniature .product-functional-buttons,
body.page-category .product-miniature .product-flags {
  display: none !important;
}

body.page-category .product-miniature .product-title {
  order: 10;
  display: block !important;
  min-height: 42px;
  margin: 0 0 9px !important;
  color: #111 !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 1.28 !important;
  text-align: left !important;
  text-transform: none !important;
}

body.page-category .product-miniature .product-title:hover,
body.page-category .product-miniature .product-title:focus {
  color: #d64513 !important;
}

body.page-category .product-miniature .product-description-short {
  order: 20;
  display: -webkit-box !important;
  min-height: 59px;
  margin: 0 0 14px !important;
  overflow: hidden;
  color: var(--oc-card-muted) !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  text-align: left !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

body.page-category .product-miniature .product-description-short a {
  color: inherit !important;
}

body.page-category .product-miniature .product-price-and-shipping {
  order: 30;
  width: auto !important;
  min-height: 72px;
  margin: auto -14px 0 !important;
  padding: 13px 14px 12px !important;
  border-top: 1px solid var(--oc-card-border);
  background: #fafafa !important;
  text-align: left !important;
}

body.page-category .product-miniature .product-price {
  color: #222 !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
}

body.page-category .product-miniature .oc-card-stock {
  display: block;
  margin-top: 3px;
  color: var(--oc-card-stock);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

body.page-category .product-miniature .oc-card-stock--out {
  color: #a66a10;
}

/* Product page: keep the category menu at the left instead of spanning the page. */
@media (min-width: 768px) {
  body.page-product #content-wrapper {
    display: grid !important;
    grid-template-columns: var(--oc-shop-sidebar-width) minmax(0, 1fr);
    column-gap: var(--oc-shop-gap);
    align-items: start;
  }

  body.page-product #content-wrapper > .oc-shop-nav {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 14px;
    width: var(--oc-shop-sidebar-width) !important;
    margin: 0;
  }

  body.page-product #content-wrapper > #main {
    grid-column: 2;
    grid-row: 1;
    width: 100% !important;
    min-width: 0;
  }

  body.page-product .product-info-row > .product-sidebar {
    display: none !important;
  }

  body.page-product .product-info-row > .col-product-image {
    flex: 0 0 47% !important;
    width: 47% !important;
    max-width: 47% !important;
  }

  body.page-product .product-info-row > .col-product-info {
    flex: 0 0 53% !important;
    width: 53% !important;
    max-width: 53% !important;
  }
}

body.page-product #iqithtmlandbanners-block-1 {
  display: none !important;
}

body.page-category .breadcrumb .oc-eshop-crumb,
body.page-product .breadcrumb .oc-eshop-crumb {
  display: inline-flex;
}

@media (min-width: 768px) and (max-width: 1199px) {
  body.page-category,
  body.page-product {
    --oc-shop-sidebar-width: 205px;
    --oc-shop-gap: 20px;
  }

  body.page-category #js-product-list .products-grid {
    gap: 16px !important;
  }

  body.page-category #js-product-list .products-grid > .js-product-miniature-wrapper {
    flex-basis: calc((100% - 16px) / 2) !important;
    width: calc((100% - 16px) / 2) !important;
    max-width: calc((100% - 16px) / 2) !important;
  }

  body.page-product .product-info-row > .col-product-image,
  body.page-product .product-info-row > .col-product-info {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media (max-width: 767px) {
  body.page-category #left-column,
  body.page-product #left-column {
    width: 100% !important;
    max-width: 100% !important;
  }

  body.page-category #content-wrapper,
  body.page-product #content-wrapper {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.page-category #content-wrapper > .oc-shop-nav,
  body.page-product #content-wrapper > .oc-shop-nav {
    width: 100% !important;
    max-width: 100% !important;
  }

  body.page-category #js-product-list .products-grid {
    gap: 10px !important;
  }

  body.page-category #js-product-list .products-grid > .js-product-miniature-wrapper {
    flex-basis: calc((100% - 10px) / 2) !important;
    width: calc((100% - 10px) / 2) !important;
    max-width: calc((100% - 10px) / 2) !important;
  }

  body.page-category .product-miniature .product-description {
    padding: 9px 9px 0 !important;
  }

  body.page-category .product-miniature .product-title {
    min-height: 33px;
    margin-bottom: 7px !important;
    font-size: 12.5px !important;
    line-height: 1.3 !important;
    text-align: center !important;
  }

  body.page-category .product-miniature .product-description-short {
    display: none !important;
  }

  body.page-category .product-miniature .product-price-and-shipping {
    min-height: 55px;
    margin-right: -9px !important;
    margin-left: -9px !important;
    padding: 9px !important;
    text-align: center !important;
  }

  body.page-category .product-miniature .product-price {
    font-size: 14px !important;
  }

  body.page-category .product-miniature .oc-card-stock {
    font-size: 11px;
  }
}

@media (max-width: 380px) {
  body.page-category #js-product-list .products-grid {
    gap: 8px !important;
  }

  body.page-category #js-product-list .products-grid > .js-product-miniature-wrapper {
    flex-basis: calc((100% - 8px) / 2) !important;
    width: calc((100% - 8px) / 2) !important;
    max-width: calc((100% - 8px) / 2) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.page-category #js-product-list .products-grid > .js-product-miniature-wrapper > .product-miniature,
  body.page-category #js-product-list .products-grid > .product-miniature {
    transition: none;
  }
}
