/**
 * FH9 Dark Fantasy — Category header skin
 * Optimized for your markup:
 * - #js-product-list-header .block-category
 * - #subcategories.subcategories .subcategory__wrapper a.subcategory
 * - nav[aria-label*="Pagination"] ul.pagination.pagination--custom
 * - .sort-by-row .products-sort-order .select-title + .dropdown-menu
 *
 * Mostly additive styles (safe), minimal structural overrides.
 */

:root{
  --fh9-bg-0: rgba(0,0,0,.62);
  --fh9-bg-1: rgba(0,0,0,.35);
  --fh9-stroke: rgba(255,255,255,.14);
  --fh9-stroke-2: rgba(255,255,255,.24);
  --fh9-glow: rgba(170, 120, 255, .20);
  --fh9-text: rgba(255,255,255,.92);
  --fh9-text-dim: rgba(255,255,255,.72);
  --fh9-accent: rgba(170,120,255,.65);
}

/* =========================================================
   Header block (title + description)
   ========================================================= */

#category #js-product-list-header .block-category{
  background: linear-gradient(180deg, var(--fh9-bg-0), var(--fh9-bg-1));
  border: 1px solid var(--fh9-stroke);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.38);
  padding: 22px 22px 16px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

#category #js-product-list-header .block-category::before{
  content:"";
  position:absolute;
  inset:-2px;
  background: radial-gradient(900px 220px at 20% 0%,
              rgba(170,120,255,.12),
              rgba(0,0,0,0) 55%);
  pointer-events:none;
}

#category #js-product-list-header h1.page-title-section{
  color: var(--fh9-text);
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 780;
  text-shadow: 0 0 22px var(--fh9-glow);
  margin: 0 0 10px !important;
  position: relative;
}

#category #js-product-list-header h1.page-title-section::after{
  content: "";
  display: block;
  height: 2px;
  width: 92px;
  margin-top: 10px;
  background: linear-gradient(90deg, rgba(255,255,255,.60), rgba(255,255,255,0));
  opacity: .95;
}

#category #js-product-list-header #category-description.rich-text,
#category #js-product-list-header #category-description{
  color: var(--fh9-text-dim);
  line-height: 1.55;
  max-width: 82ch;
}

/* =========================================================
   Subcategories (tiles)
   ========================================================= */

#category #subcategories.subcategories{
  margin: 8px 0 18px;
}

#category #subcategories.subcategories.row{
  row-gap: 12px;
}

#category #subcategories .subcategory__wrapper > a.subcategory{
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 12px;

  padding: 14px 14px;
  border-radius: 12px;
  border: 1px solid var(--fh9-stroke);
  background: rgba(0,0,0,.28);
  box-shadow: 0 8px 22px rgba(0,0,0,.30);
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease, background .12s ease;
  text-decoration: none;
  height: 100%;
}

#category #subcategories .subcategory__wrapper > a.subcategory:hover{
  transform: translateY(-1px);
  border-color: var(--fh9-stroke-2);
  background: rgba(0,0,0,.36);
  box-shadow: 0 12px 28px rgba(0,0,0,.36);
}

#category #subcategories .subcategory__image{
  width: 54px;
  height: 54px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.28);
  overflow: hidden;
  display: grid;
  place-items: center;
}

#category #subcategories .subcategory__image img{
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
}

#category #subcategories p.subcategory__name{
  margin: 0 !important;
  color: var(--fh9-text);
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.15;
}

#category #subcategories .subcategory__wrapper > a.subcategory:focus{
  outline: none;
  box-shadow: 0 0 0 3px rgba(170, 120, 255, .16), 0 12px 28px rgba(0,0,0,.36);
  border-color: var(--fh9-stroke-2);
}

/* =========================================================
   Pagination (your markup)
   ========================================================= */

#category nav[aria-label*="Pagination"]{
  margin-top: 18px;
}

#category nav[aria-label*="Pagination"] .pagination.pagination--custom{
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin: 0;
}

#category nav[aria-label*="Pagination"] .page-item{
  margin: 0 !important;
}

#category nav[aria-label*="Pagination"] .page-link{
  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--fh9-stroke);
  background: rgba(0,0,0,.26);
  color: var(--fh9-text);
  box-shadow: 0 8px 20px rgba(0,0,0,.28);
  text-decoration: none;
  transition: transform .12s ease, border-color .12s ease, background .12s ease, box-shadow .12s ease;
}

#category nav[aria-label*="Pagination"] .page-link:hover{
  transform: translateY(-1px);
  border-color: var(--fh9-stroke-2);
  background: rgba(0,0,0,.34);
  box-shadow: 0 12px 26px rgba(0,0,0,.34);
}

#category nav[aria-label*="Pagination"] .page-item.active .page-link{
  background: linear-gradient(180deg, rgba(170,120,255,.22), rgba(0,0,0,.30));
  border-color: rgba(170,120,255,.45);
  color: var(--fh9-text);
  text-shadow: 0 0 16px var(--fh9-glow);
}

#category nav[aria-label*="Pagination"] .page-link.disabled,
#category nav[aria-label*="Pagination"] .page-link[aria-disabled="true"]{
  opacity: .55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

#category nav[aria-label*="Pagination"] .page-link i.material-icons{
  font-size: 18px;
  opacity: .9;
}

@media (max-width: 575.98px){
  #category nav[aria-label*="Pagination"] .page-link span{
    display: none !important;
  }
}

/* =========================================================
   Sort dropdown (your markup)
   ========================================================= */

#category .sort-by-row{
  gap: 10px;
}

#category .sort-by-row .sort-by{
  color: var(--fh9-text-dim);
  letter-spacing: .02em;
}

#category .sort-by-row .sort-by i.material-icons{
  font-size: 18px;
  opacity: .85;
  margin-right: 6px;
}

/* The button that shows "Pertinence" */
#category .sort-by-row .products-sort-order .select-title.btn{
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  min-width: 280px;         /* gives the premium wide look you showed */
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 12px;

  background: rgba(0,0,0,.26);
  border: 1px solid var(--fh9-stroke);
  color: var(--fh9-text);

  box-shadow: 0 8px 20px rgba(0,0,0,.28);
  transition: transform .12s ease, border-color .12s ease, background .12s ease, box-shadow .12s ease;
}

#category .sort-by-row .products-sort-order .select-title.btn:hover{
  transform: translateY(-1px);
  border-color: var(--fh9-stroke-2);
  background: rgba(0,0,0,.34);
  box-shadow: 0 12px 26px rgba(0,0,0,.34);
}

#category .sort-by-row .products-sort-order .select-title.btn:focus{
  outline: none;
  box-shadow: 0 0 0 3px rgba(170, 120, 255, .12), 0 12px 26px rgba(0,0,0,.34);
  border-color: var(--fh9-stroke-2);
}

/* caret icon */
#category .sort-by-row .products-sort-order .select-title i.material-icons{
  font-size: 20px;
  opacity: .9;
}

/* dropdown menu itself */
#category .sort-by-row .products-sort-order .dropdown-menu{
  margin-top: 8px;
  padding: 8px;

  background: rgba(10,10,10,.92);
  border: 1px solid var(--fh9-stroke);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0,0,0,.55);
}

/* items */
#category .sort-by-row .products-sort-order .dropdown-item{
  border-radius: 10px;
  padding: 10px 10px;
  color: var(--fh9-text-dim);
  transition: background .12s ease, color .12s ease;
}

#category .sort-by-row .products-sort-order .dropdown-item:hover{
  background: rgba(255,255,255,.06);
  color: var(--fh9-text);
}

/* current selection */
#category .sort-by-row .products-sort-order .dropdown-item.current{
  background: rgba(170,120,255,.14);
  color: var(--fh9-text);
  border: 1px solid rgba(170,120,255,.22);
}

/* small screens: let it be full width */
@media (max-width: 575.98px){
  #category .sort-by-row .products-sort-order{
    width: 100%;
  }
  #category .sort-by-row .products-sort-order .select-title.btn{
    width: 100%;
    min-width: 0;
  }
}

/* =========================================================
   Count row / form controls (kept)
   ========================================================= */

#category .total-products,
#category .products-selection .total-products,
#category .products-selection .sort-by-row{
  color: var(--fh9-text-dim);
}

#category .products-selection select,
#category .products-selection .form-control{
  background: rgba(0,0,0,.35);
  border: 1px solid var(--fh9-stroke);
  color: var(--fh9-text);
  border-radius: 10px;
}

#category .products-selection select:focus,
#category .products-selection .form-control:focus{
  outline: none;
  box-shadow: 0 0 0 3px rgba(170, 120, 255, .12);
  border-color: var(--fh9-stroke-2);
}
