/* ORAN Store TEST r16 – Compact populated category listings + Turkish presentation.
 * Only #category pages with product miniatures are affected by category CSS.
 * The r15 empty-category styling remains unchanged.
 * Keep real faceted filters/extra side modules visible; collapse the column ONLY
 * when ps_categorytree is its sole direct child.
 * No change to logo dimensions, header, product/stock data, or payments.
 */

/* A category label is already present in the H1 and main navigation. Suppress
   only the redundant ps_categorytree widget on populated category listings.
   Other sidebar modules (notably faceted filters) are never hidden by this rule. */
body#category:has(#products .product-miniature) #left-column > .category-tree {
  display: none !important;
}

/* Collapse the otherwise vacant column only when it contains JUST the tree.
   If faceted search or any other module exists, keep its grid and full width. */
body#category:has(#products .product-miniature) #left-column:has(> .category-tree):not(:has(> :not(.category-tree))) {
  display: none !important;
}
body#category:has(#products .product-miniature):has(#left-column > .category-tree):not(:has(#left-column > :not(.category-tree))) #content-wrapper {
  box-sizing: border-box;
  float: none !important;
  clear: both;
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  padding-right: 15px;
  padding-left: 15px;
}

/* Classic .block-category has min-height:13.75rem (220px): the main reason
   the product list starts far below the category title. */
body#category:has(#products .product-miniature) #js-product-list-header .block-category {
  box-sizing: border-box;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 0 16px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
body#category:has(#products .product-miniature) #js-product-list-header .block-category h1 {
  margin: 0 !important;
  padding: 0 !important;
  font-family: Arial, "Segoe UI", sans-serif;
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  color: #152e5a;
  text-transform: none;
}
/* Keep real descriptions/images; don't reserve a blank row when both absent. */
body#category:has(#products .product-miniature) #js-product-list-header .block-category-inner:not(:has(#category-description:not(:empty), .category-cover img)) {
  display: none !important;
}
body#category:has(#products .product-miniature) #js-product-list-header .block-category-inner:has(#category-description:not(:empty), .category-cover img) {
  margin-top: 11px;
}
body#category:has(#products .product-miniature) #products .products-selection {
  margin-top: 0;
  margin-bottom: 12px;
}

/* The warning must remain visible; this is a translation, NOT a stock override. */
body#category .product-flags li.product-flag.out_of_stock,
body#product .product-flags li.product-flag.out_of_stock,
body#index .product-flags li.product-flag.out_of_stock {
  background: #fff0f6 !important;
  color: #a81865 !important;
  border-radius: 5px;
  font-size: 11px !important;
  line-height: 1.2;
}

/* Product page: make the existing 3 informational module blocks legible.
   Module links, icon paths and hook are kept unchanged. */
body#product .blockreassurance_product {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 13px 0 18px;
}
body#product .blockreassurance_product > div:not(.clearfix) {
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #edf0f6;
  border-radius: 10px;
  background: #f9fbff;
}
body#product .blockreassurance_product .item-product {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 25px;
  margin: 0;
}
body#product .blockreassurance_product .item-product img {
  display: block;
  max-width: 23px;
  max-height: 23px;
}
body#product .blockreassurance_product .block-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: #20385c !important;
}
body#product .blockreassurance_product > div:not(.clearfix) > p:not(.block-title) {
  margin: 3px 0 0;
  line-height: 1.4;
}
body#product .blockreassurance_product .clearfix {
  display: none;
}

@media (max-width: 767px) {
  body#category:has(#products .product-miniature):has(#left-column > .category-tree):not(:has(#left-column > :not(.category-tree))) #content-wrapper {
    padding-left: 10px;
    padding-right: 10px;
  }
  body#category:has(#products .product-miniature) #js-product-list-header .block-category {
    margin-bottom: 12px !important;
  }
  body#category:has(#products .product-miniature) #js-product-list-header .block-category h1 {
    font-size: clamp(21px, 5.6vw, 27px);
  }
  body#product .blockreassurance_product > div:not(.clearfix) {
    padding: 9px 10px;
  }
}
