/* Shared grid card layout, including pages served with an older theme bundle. */
:is(#res-products, #content) > .product-grid.row .product {
  display: flex;
  flex-direction: column;
  min-height: 0 !important;
}

:is(#res-products, #content) > .product-grid.row .product > .image {
  position: relative;
  flex: none;
  width: 100%;
  height: auto !important;
  min-height: 0;
  max-height: none;
  aspect-ratio: 1;
  margin: 0;
  padding: 0 !important;
  border-radius: 14px;
  overflow: hidden;
}

:is(#res-products, #content) > .product-grid.row .product > .image > a:not(.popup_view_button):not(.pb-cat-slide-view) {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

:is(#res-products, #content) > .product-grid.row .product > .image img {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: contain;
}

:is(#res-products, #content) > .product-grid.row .product > .product-about {
  position: static !important;
  transform: none !important;
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  height: auto !important;
  padding: 8px;
  background: #fafafa;
  font-family: Inter, Arial, sans-serif;
  text-align: left;
}

:is(#res-products, #content) > .product-grid.row .product > .product-about > .price {
  order: 1;
  display: flex;
  flex: 0 0 auto;
  align-items: baseline;
  gap: 4px;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 0 2px !important;
  padding: 0 0 0 4px;
  border: 0 !important;
  color: #b72126;
  font-family: Inter, Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
}

:is(#res-products, #content) > .product-grid.row .product > .product-about > .name {
  order: 2;
  height: 3.75em !important;
  min-height: 3.75em;
  margin: 0 0 4px;
  padding: 0 !important;
  overflow: hidden;
}

:is(#res-products, #content) > .product-grid.row .product > .product-about > .name,
:is(#res-products, #content) > .product-grid.row .product > .product-about > .name a {
  font-family: Inter, Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.25 !important;
  text-align: left;
}

:is(#res-products, #content) > .product-grid.row .product > .product-about > .name a {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
}

:is(#res-products, #content) > .product-grid.row .product > .product-about >
  :is(.rating, .description, .oct-cat-stock) {
  display: none !important;
}

:is(#res-products, #content) > .product-grid.row .product > .product-about > .product-buttons {
  order: 4;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-top: 8px;
}

:is(#res-products, #content) > .product-grid.row .product > .product-about > .product-buttons > .additional {
  display: none !important;
}

:is(#res-products, #content) > .product-grid.row .product > .product-about > .product-buttons > .cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto !important;
  min-height: 32px;
  padding: 7px 13px;
  border-radius: 8px;
  font-family: Inter, Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-transform: none;
}

@media (max-width: 359px) {
  :is(#res-products, #content) > .product-grid.row .product > .product-about > .price {
    gap: 3px;
    font-size: 16px;
  }
}

/* Search uses the same card markup directly inside its content column. */
#content > .product-grid.row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

#content > .product-grid.row::before,
#content > .product-grid.row::after {
  display: none;
}

#content > .product-grid.row > .cols {
  display: flex;
  min-width: 0;
  padding-inline: 4px;
}

#content > .product-grid.row > .cols > .product {
  width: 100%;
  height: auto !important;
  margin-bottom: 8px;
}

@media (max-width: 767px) {
  #content > .product-grid.row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 6px;
    margin-inline: 0;
  }

  #content > .product-grid.row > .cols {
    width: auto;
    padding: 0;
  }

  #content > .product-grid.row > .cols > .product {
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
  }
}

#content > .product-grid.row .product > .product-about > .price .price-new {
  order: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  white-space: nowrap;
}

#content > .product-grid.row .product > .product-about > .price .price-old {
  order: 1;
  color: #888;
  font-size: 12px;
  font-weight: 400;
  text-decoration: line-through;
  white-space: nowrap;
}

#content > .product-grid.row .product > .product-about > .price .pb-price-discount {
  order: 2;
  font-size: 12px;
  white-space: nowrap;
}

/* Carousel modules use standalone price and name blocks. */
#oct-wrap :is(.item:has(> .image):has(> .price), .product-box-item .swiper-slide:has(> .img-box)):has(> .name) {
  background-color: #fafafa;
  text-align: left;
}

#oct-wrap .item:has(> .image):has(> .price):has(> .name) {
  display: flex;
  flex-direction: column;
}

#oct-wrap :is(.item:has(> .image):has(> .price), .product-box-item .swiper-slide:has(> .img-box)):has(> .name)
  > :is(.image, .img-box) {
  order: 0;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
}

#oct-wrap .item:has(> .image):has(> .price):has(> .name) > .price {
  order: 1;
  margin: 8px 8px 2px 12px !important;
}

#oct-wrap .product-box-item .swiper-slide:has(> .img-box):has(> .name) {
  gap: 2px 4px;
}

#oct-wrap .product-box-item .swiper-slide:has(> .img-box):has(> .name) > .price-new {
  order: 1;
  margin: 8px 0 2px 12px;
}

#oct-wrap .product-box-item .swiper-slide:has(> .img-box):has(> .name) > .price-old {
  order: 2;
  font-size: 12px;
}

#oct-wrap :is(.item:has(> .image):has(> .name) > .price,
              .product-box-item .swiper-slide:has(> .img-box):has(> .name) > .price-new) {
  color: #b72126;
  font-family: Inter, Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

#oct-wrap .item:has(> .image):has(> .price):has(> .name) > .name {
  order: 2;
}

#oct-wrap .product-box-item .swiper-slide:has(> .img-box):has(> .name) > .name {
  order: 3;
  flex-basis: calc(100% - 16px);
}

#oct-wrap :is(.item:has(> .image):has(> .price), .product-box-item .swiper-slide:has(> .img-box)):has(> .name) > .name {
  margin: 0 8px 8px !important;
  padding: 0 !important;
  height: auto !important;
  max-height: 3.75em;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.25 !important;
  white-space: normal !important;
}

#oct-wrap :is(.item:has(> .image):has(> .price), .product-box-item .swiper-slide:has(> .img-box)):has(> .name)
  > .name :is(a, span) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  height: auto !important;
  overflow-wrap: anywhere;
  overflow: hidden;
  font-family: Inter, Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.25;
  text-align: left;
  white-space: normal !important;
}

#oct-wrap :is(.item:has(> .image):has(> .price), .product-box-item .swiper-slide:has(> .img-box)):has(> .name) > .rating {
  display: none !important;
}

@media (max-width: 359px) {
  #oct-wrap :is(.item:has(> .image):has(> .name) > .price,
                .product-box-item .swiper-slide:has(> .img-box):has(> .name) > .price-new) {
    font-size: 16px;
  }
}
