/* FlySpark catalog (/products/category/*) on the Olight SHOP LAYOUT 01 template. Theme classes carry the look;
   this file only fills gaps where FlySpark content differs from the demo (photos, extra copy, per-page select). */

/* breadcrumb banner: the theme's `[dir] #wrapper .breadcrumb-bg` (right:50% + translateX(50%)) only centres in RTL;
   in LTR `left:50%` from `.breadcrumb-full` wins, so restore the `.breadcrumb-full` centring */
[dir='ltr'] #wrapper [data-fs-page='catalog'] .breadcrumb-bg.breadcrumb-full {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}
/* per-category banner (catalog-theme.tsx breadcrumbBanner): 1920px file, 2880px on 2x screens wider than a phone */
[data-fs-page='catalog'] .breadcrumb-bg[data-fs-banner] {
  background-image: var(--fs-banner);
}
@media (min-width: 768px) and (min-resolution: 1.5dppx) {
  [data-fs-page='catalog'] .breadcrumb-bg[data-fs-banner] {
    background-image: var(--fs-banner-2x);
  }
}
/* product photos are mixed aspect ratios: show them whole inside the demo's 400x426 tile */
[data-fs-page='catalog'] .thumbnail-container .product-image .product-thumbnail {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: #f5f5f5;
}
[data-fs-page='catalog'] .thumbnail-container .product-image .product-thumbnail img {
  width: 100%;
  height: auto;
  aspect-ratio: 400 / 426;
  object-fit: contain;
}
[data-fs-page='catalog'] .thumbnail-container .second-image-style {
  display: block;
  background: #f5f5f5;
}
[data-fs-page='catalog'] .product_list.list .thumbnail-container .product-image .product-thumbnail img {
  aspect-ratio: 1 / 1;
}

[data-fs-page='catalog'] .product-flags .product-flag.pack {
  background: #22201d;
  color: #fff;
}
/* theme "New" flag is white on green #9cbb14 (off-palette, 2.2:1) */
[data-fs-page='catalog'] .product-flags .product-flag.new {
  background: #fade58;
  color: #000;
}

[data-fs-page='catalog'] .product-meta .product-title a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
[data-fs-page='catalog'] .product_list.list .product-meta .product-title a {
  -webkit-line-clamp: 3;
}
[data-fs-page='catalog'] .product_list.list .product-description-short {
  display: -webkit-box !important;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 6px 0 10px;
}
[data-fs-page='catalog'] .product-price-and-shipping .fs-price-note {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #6b6b6b;
}
[data-fs-page='catalog'] .product-price-and-shipping .fs-stock {
  margin-inline-start: 8px;
  color: #22201d;
}

/* demo grid cards carry no short description (category, title, price); the list view shows it */
[data-fs-page='catalog'] .product_list.grid .product-description-short,
[data-fs-page='catalog'] #left-column .product-description-short {
  display: none;
}
[data-fs-page='catalog'] .product_list.list .ajax_block_product {
  margin-bottom: 30px;
}
[data-fs-page='catalog'] .product_list.list .thumbnail-container .product-price-and-shipping {
  justify-content: flex-start;
}
[data-fs-page='catalog'] .product_list.list .product-meta .button-container.cart {
  text-align: start;
}

/* sidebar category tree: current hub */
[data-fs-page='catalog'] .block-categories .category-sub-menu li.current > a {
  color: #22201d;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: #fade58;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* search facet (FlySpark catalog keeps its text search) */
[data-fs-page='catalog'] .fs-facet-search {
  position: relative;
}
[data-fs-page='catalog'] .fs-facet-search .form-control {
  height: 42px;
  padding: 0 40px 0 14px;
  border: 1px solid #eaeae9;
  border-radius: 30px;
  font-size: 14px;
  background: #fff;
}
[data-fs-page='catalog'] .fs-facet-search .material-icons {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: #22201d;
  pointer-events: none;
}

/* toolbar: per-page select next to sort */
[data-fs-page='catalog'] .sort-by-row {
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
}
[data-fs-page='catalog'] .products-sort-order .dropdown-menu .select-list {
  cursor: pointer;
}
[data-fs-page='catalog'] .products-sort-order.fs-per-page {
  margin-left: 24px;
  padding-left: 0;
}
[data-fs-page='catalog'] #btn_view_product .grid-select {
  cursor: pointer;
}

/* hover CTA: the theme parks the hidden button 30px below the card (over the next row) and fades it out, so a
   half-faded outline lingers under the price; keep it inside the card, fade in on hover, hide at once on leave */
@media (min-width: 992px) {
  [data-fs-page='catalog'] .plist-style-1 .thumbnail-container .cart {
    bottom: 0;
    pointer-events: none;
    transition: none;
  }
  [data-fs-page='catalog'] .plist-style-1 .thumbnail-container:hover .cart {
    pointer-events: auto;
    transition: opacity 0.3s ease, visibility 0s;
  }
}

/* pagination before hydration (theme hook class `.pagination` is applied once React owns the node) */
[data-fs-page='catalog'] .pagination-ssr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
  padding: 20px 0 0;
  border-top: 1px solid #eaeae9;
}
[data-fs-page='catalog'] .pagination-ssr .page-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
}

/* category description block */
[data-fs-page='catalog'] .block-category .fs-category-cta {
  margin-top: 1.25rem;
}
[data-fs-page='catalog'] .fs-whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
[data-fs-page='catalog'] .fs-whatsapp-btn .material-icons {
  font-size: 18px;
}
/* category CTA: theme outline button (the filled black button competed with the h1) */
[data-fs-page='catalog'] .block-category .fs-whatsapp-btn.btn-primary {
  background: transparent;
  border: 1px solid #22201d;
  color: #22201d;
}
[data-fs-page='catalog'] .block-category .fs-whatsapp-btn.btn-primary:hover {
  background: #fade58;
  border-color: #fade58;
  color: #000;
}
/* money-system links: theme tag-cloud pills (`.block_content a` in the Leo tags block) */
[data-fs-page='catalog'] #category-hub-links .block_content {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 1rem;
}
[data-fs-page='catalog'] #category-hub-links .block_content a {
  display: inline-block;
  padding: 6px 14px;
  font-size: 13px;
  line-height: 1.4;
  color: #22201d;
  background: #f4f3f1;
  border: 1px solid #eaeae9;
  border-radius: 30px;
  text-decoration: none;
  transition: background-color 0.2s, border-color 0.2s;
}
[data-fs-page='catalog'] #category-hub-links .block_content a:hover {
  background: #fade58;
  border-color: #fade58;
  color: #000;
}
/* featured systems: one full row of equal tiles (the theme's 1/5-width flex items leave the row half empty) */
[data-fs-page='catalog'] #subcategories .subcategories-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px;
  margin: 0;
}
[data-fs-page='catalog'] #subcategories .subcategories-list li {
  width: auto;
  padding: 0;
}
[data-fs-page='catalog'] #subcategories .subcategory-image a {
  overflow: hidden;
  background: #f5f5f5;
}
[data-fs-page='catalog'] #subcategories .subcategory-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #f5f5f5;
}
[data-fs-page='catalog'] #subcategories .subcategory-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}
[data-fs-page='catalog'] #subcategories .subcategory-title .subcategory-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: break-word;
}

[data-fs-page='catalog'] .fs-empty {
  padding: 60px 0;
  text-align: center;
}

/* hub guide (rendered after the catalog by CatalogPageBody) */
#category-guide {
  margin: 20px 0 60px;
}
#category-guide #category-description-guide p {
  margin-bottom: 1rem !important;
  line-height: 1.7;
}
#category-guide .table-responsive {
  margin: 30px 0 40px;
}
#category-guide .table th {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #22201d;
  background: #f5f5f5;
}
#category-guide .table td {
  font-size: 14px;
  vertical-align: top;
}
#category-guide .table .product-name {
  font-weight: 600;
  color: #22201d;
}
#category-guide .subcategory-heading {
  margin-bottom: 20px;
}
#category-guide .elementor-accordion .elementor-accordion-item {
  border-color: #eaeae9;
}
#category-guide .elementor-accordion .elementor-tab-title {
  color: #22201d;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}
#category-guide .elementor-accordion .elementor-tab-content {
  padding: 0 20px 18px;
  font-size: 14px;
  line-height: 1.7;
  color: #6b6b6b;
}

/* mobile filter panel: category links (the theme hides the sidebar tree below 768px) */
[data-fs-page='catalog'] .fs-facet-categories ul li {
  padding: 4px 0;
}
[data-fs-page='catalog'] .fs-facet-categories ul li.current > a {
  color: #22201d;
  font-weight: 600;
}

/* route loading skeleton */
.fs-catalog-loading .fs-skel-banner {
  background: #f5f5f5;
}
.fs-catalog-loading .fs-skel {
  background: #f2f2f2;
  border-radius: 8px;
  margin: 0 0 14px;
  animation: fs-skel-pulse 1.2s ease-in-out infinite;
}
.fs-catalog-loading .fs-skel-title {
  height: 22px;
  width: 50%;
  margin-top: 40px;
}
.fs-catalog-loading .fs-skel-line {
  height: 14px;
}
.fs-catalog-loading .fs-skel-h1 {
  height: 40px;
  width: 60%;
  margin-top: 40px;
}
.fs-catalog-loading .fs-skel-card {
  height: 0;
  padding-bottom: 130%;
  border-radius: 18px;
  margin-bottom: 30px;
}
@keyframes fs-skel-pulse {
  50% {
    opacity: 0.55;
  }
}

/* RTL editions: the theme's float grid has no RTL build loaded, so mirror columns and offsets here */
[dir='rtl'] [data-fs-page='catalog'] [class*='col-'] {
  float: right;
}
@media (min-width: 768px) {
  [dir='rtl'] .fs-hub-guide-wrap .offset-md-4 {
    margin-left: 0;
    margin-right: 33.333333%;
  }
}
@media (min-width: 768px) {
  [dir='rtl'] [data-fs-page='catalog'] .pagination .offset-md-2 {
    margin-left: 0;
    margin-right: 16.666667%;
  }
  [dir='rtl'] [data-fs-page='catalog'] .pagination .page-list {
    text-align: left !important;
  }
}
@media (min-width: 992px) {
  [dir='rtl'] .fs-hub-guide-wrap .offset-lg-3 {
    margin-left: 0;
    margin-right: 25%;
  }
}
/* the hub's sr-only link navs sit at the static RTL position 1px past the right edge (horizontal scroll) */
[dir='rtl'] [data-fs-page='catalog'] ~ nav.sr-only {
  left: 0;
}
[dir='rtl'] [data-fs-page='catalog'] .block-categories .category-sub-menu li,
[dir='rtl'] [data-fs-page='catalog'] #search_filters .facet,
[dir='rtl'] [data-fs-page='catalog'] .block-category {
  text-align: right;
}

/* featured systems: the demo hides subcategories on phones; FlySpark keeps them as a compact 2-up grid */
@media (max-width: 767px) {
  [data-fs-page='catalog'] #subcategories .subcategories-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}
@media (max-width: 480px) {
  [data-fs-page='catalog'] #subcategories ul li .subcategory-name {
    font-size: 13px;
    line-height: 1.35;
  }
  [data-fs-page='catalog'] #subcategories .subcategory-heading {
    font-size: 22px;
    line-height: 28px;
  }
}

@media (max-width: 767px) {
  [data-fs-page='catalog'] #btn_view_product {
    display: none;
  }
  [data-fs-page='catalog'] .products-sort-order.fs-per-page {
    margin-left: 12px;
  }
  [data-fs-page='catalog'] .sort-by-row {
    flex-wrap: wrap;
  }
}

@media (max-width: 767px) {
  [data-fs-page='catalog'] #search_filters .facet-label {
    display: flex;
    align-items: center;
    min-height: 44px;
    width: 100%;
    cursor: pointer;
  }
}
