/* ========================================================================================
   LWR SITES - GLOBAL SEARCH RESULTS PAGE CUSTOMIZATION
   ========================================================================================
   
   CRITICAL: HIDE SEARCH SIDEBAR IMMEDIATELY
   Must be at top to prevent flash on load
   ======================================================================================== */

/* Hide left sidebar with filters */
search_results-navigation,
search_results-objects-navigation,
.navigation__separator,
.navigation__filters,
.object-navigation-container {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  position: absolute !important;
  left: -9999px !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* Make search results take full width - remove box appearance */
.search-results-container,
dxp_crm_search-search-results,
.dxp_search-dynamic-crm-results {
  width: 100% !important;
  max-width: 100% !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.scoped-results-container,
dxp_crm_search-scoped-results-container {
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* ========================================================================================
   HEADER STYLING - Match Experience Cloud Design
   ======================================================================================== */

/* Overall results container - transparent, no box, centered - FORCE WITH HIGH SPECIFICITY */
dxp_crm_search-scoped-results-container.scoped-results-container,
dxp_crm_search-scoped-results-container .scoped-results-container,
div.scoped-results-container,
.scoped-results-container {
  max-width: 1200px !important; /* Constrain max width */
  margin: 0 auto !important; /* Center horizontally */
  padding: 0 40px !important; /* Add side padding */
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Results header - centered, constrain width - FORCE (top spacing handled by header-meta margin) */
dxp_crm_search-scoped-results-container div.results-header,
dxp_crm_search-scoped-results-container .results-header,
article.slds-card div.results-header,
.results-header,
div.results-header {
  max-width: 900px !important;
  margin: 0 auto !important; /* Center horizontally */
  padding: 0 0 24px 0 !important; /* No top padding, spacing from header-meta margin */
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Card body container - constrain width, centered - FORCE */
article.slds-card .slds-card__body.slds-grow,
.slds-card__body.slds-grow,
div.slds-card__body.slds-grow {
  max-width: 900px !important;
  margin: 0 auto !important; /* Center horizontally */
  padding: 0 0 40px 0 !important; /* Remove horizontal padding, handled by parent */
  background: transparent !important;
}

/* Header container - remove all backgrounds and borders, add top margin, CENTER to align with article cards */
dxp_crm_search-header-meta,
dxp_crm_search-header-meta.lwc-622rpr4hecm-host,
.scoped-bucket__card__header {
  padding: 0 !important;
  margin-top: 250px !important; /* 250px top spacing for desktop */
  margin-bottom: 0 !important;
  margin-left: auto !important; /* Center horizontally - same as article cards */
  margin-right: auto !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  text-align: left !important; /* Text inside is left-aligned */
  display: block !important;
  width: 100% !important;
  max-width: 900px !important; /* Match article cards width - this creates left alignment */
}

/* Force left alignment for ALL child elements */
dxp_crm_search-header-meta *,
dxp_crm_search-header-meta.lwc-622rpr4hecm-host * {
  text-align: left !important;
}

/* Override any parent container centering */
dxp_crm_search-scoped-results-container,
dxp_crm_search-scoped-results-container.scoped-results-container,
.scoped-results-container,
article.scoped-results__card {
  display: block !important;
  text-align: left !important;
}

/* Force results header to align left */
.results-header,
div.results-header,
dxp_crm_search-scoped-results-container .results-header {
  display: block !important;
  text-align: left !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
}

.slds-card__header.slds-grid,
.slds-card__header.slds-grid.scoped-bucket__card__header,
dxp_crm_search-header-meta .slds-card__header.slds-grid,
dxp_crm_search-header-meta div.slds-card__header.slds-grid,
div.lwc-622rpr4hecm.slds-card__header.slds-grid {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  text-align: left !important;
  display: block !important; /* Override display: flex from slds-grid */
  justify-content: flex-start !important;
  align-items: flex-start !important;
}

/* Override inline margin-top and ensure proper styling - no centering offset */
dxp_crm_search-header-meta .slds-media__body,
.slds-media__body,
header.slds-media .slds-media__body,
header.lwc-622rpr4hecm .slds-media__body {
  width: 100% !important;
  max-width: 100% !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
  display: block !important;
}

/* Remove white box from article container */
article.scoped-results__card,
.scoped-results__card,
article.slds-card.scoped-results__card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Also ensure header element has no borders and aligns properly - NO centering */
header.slds-media,
header.slds-media.slds-media_center,
dxp_crm_search-header-meta header.slds-media,
header.lwc-622rpr4hecm.slds-media.slds-media_center,
.lwc-622rpr4hecm.slds-media.slds-media_center,
dxp_crm_search-header-meta header.slds-media.slds-media_center.slds-has-flexi-truncate {
  width: 100% !important;
  max-width: 100% !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important; /* Override flexbox display */
  justify-content: flex-start !important; /* Remove flexbox centering */
  align-items: flex-start !important; /* Remove vertical centering */
  flex-direction: column !important; /* Stack vertically */
}

/* Remove grid borders */
.listViewContainer,
.slds-border__left,
.slds-border__right {
  border-left: none !important;
  border-right: none !important;
}

/* "Knowledge" heading - replace with "Search results" - ONLY for main header */
dxp_crm_search-header-meta h2.slds-card__header-title,
dxp_crm_search-header-meta .slds-card__header-title {
  font-size: 0 !important;
  color: transparent !important;
  position: relative !important;
  text-align: left !important; /* Force left align */
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  display: block !important;
}

dxp_crm_search-header-meta h2.slds-card__header-title::before,
dxp_crm_search-header-meta .slds-card__header-title::before {
  content: "Search results" !important;
  display: inline-block !important; /* Changed from block to inline-block */
  font-family: var(--dxp-s-header-font-family, 'Axiforma-Light', sans-serif) !important;
  font-size: 56px !important;
  font-weight: 300 !important;
  line-height: 68px !important;
  letter-spacing: -2px !important;
  color: #13131F !important;
  text-align: left !important; /* Left-align the header */
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important; /* Changed from 100% to auto */
  position: relative !important;
  left: 0 !important;
  transform: none !important;
}

/* Results count and sorting row - flex layout with "5 Results" on left, "Sort by" on right */
dxp_crm_search-header-meta .slds-text-body--small,
dxp_crm_search-header-meta .slds-text-color--weak {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important; /* Align to left */
  width: 100% !important;
  font-family: 'Calibre', sans-serif !important;
  font-size: 18px !important;
  font-weight: 400 !important;
  line-height: 24px !important;
  color: #6B7280 !important;
  margin-top: 16px !important;
  gap: 16px !important;
  text-align: left !important; /* Left-align text */
}

/* Results count on the left - match Experience Cloud font exactly */
.header-meta__count-label,
span.header-meta__count-label {
  font-family: var(--dxp-s-form-element-text-font-family, 'Calibre', sans-serif) !important;
  font-size: 18px !important;
  font-weight: 400 !important;
  line-height: 24px !important;
  color: #6B7280 !important;
  flex: 0 0 auto !important;
  letter-spacing: normal !important;
}

/* Hide dot separator */
dxp_crm_search-header-meta .slds-text-body--small > span:not(.header-meta__count-label) {
  display: none !important;
}

/* Hide "Sorted by" text */
#sortLabel {
  display: none !important;
  font-size: 0 !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
}

/* Sort dropdown container - align to right */
dxp_crm_search-header-meta lightning-button-menu {
  margin-left: auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

/* Add "Sort by" label before dropdown using ::before - match Experience Cloud font */
dxp_crm_search-header-meta lightning-button-menu::before {
  content: "Sort by" !important;
  font-family: var(--dxp-s-form-element-text-font-family, 'Calibre', sans-serif) !important;
  font-size: 18px !important;
  font-weight: 400 !important;
  line-height: 24px !important;
  color: #6B7280 !important;
  white-space: nowrap !important;
  letter-spacing: normal !important;
}

/* Sort dropdown button - match Experience Cloud font */
dxp_crm_search-header-meta lightning-button-menu button,
lightning-button-menu button {
  background: transparent !important;
  border: 1px solid #E5E5E9 !important;
  border-radius: 8px !important;
  padding: 8px 16px !important;
  font-family: var(--dxp-s-form-element-text-font-family, 'Calibre', sans-serif) !important;
  font-size: 18px !important;
  font-weight: 400 !important;
  line-height: 24px !important;
  color: #101820 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  letter-spacing: normal !important;
}

dxp_crm_search-header-meta lightning-button-menu button:hover,
lightning-button-menu button:hover {
  border-color: #CBCBD4 !important;
  box-shadow: 0px 2px 10px 0px rgba(156, 173, 252, 0.2) !important;
}

/* ========================================================================================
   RESULT CARDS STYLING
   ======================================================================================== */

/* Card container - constrain width like Experience Cloud */
search_results-result-stencil-card {
  display: block !important;
  margin-bottom: 16px !important;
  max-width: 100% !important;
}

.result-card-container {
  width: 100% !important;
  max-width: 100% !important;
}

/* List container - constrain width */
lst-template-list > div.slds-card__body,
.slds-card__body.slds-wrap.slds-scrollable {
  max-width: 100% !important;
  padding: 0 !important;
}

.result-card-inner {
  background: white !important;
  border: 1px solid #E5E5E9 !important;
  border-radius: 12px !important;
  padding: 24px !important;
  margin-bottom: 0 !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
  transition: all 0.2s ease !important;
}

.result-card-inner:hover {
  border-color: #CBCBD4 !important;
  box-shadow: 0px 4px 12px 0px rgba(156, 173, 252, 0.25) !important;
  transform: translateY(-2px) !important;
}

/* Hide bottom spacing */
.bottom-spacing {
  display: none !important;
}

/* Card header */
search_results-result-stencil-card .slds-card__header,
.result-card-inner .slds-card__header {
  padding: 0 !important;
  margin-bottom: 8px !important;
  border-bottom: none !important;
}

/* Card title - h3 element */
search_results-result-stencil-card h3.slds-card__header-title,
.result-card-inner h3.slds-card__header-title {
  margin: 0 !important;
  padding: 0 !important;
  font-size: inherit !important;
  color: inherit !important;
}

search_results-result-stencil-card h3.slds-card__header-title::before,
.result-card-inner h3.slds-card__header-title::before {
  content: none !important;
  display: none !important;
}

/* Card title link */
search_results-result-stencil-card .title-field,
.result-card-inner .title-field,
.result-card-container .title-field {
  font-family: 'Calibre', sans-serif !important;
  font-size: 20px !important;
  font-weight: 600 !important;
  line-height: 24px !important;
  color: #101820 !important;
  text-decoration: none !important;
  display: block !important;
  border: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

search_results-result-stencil-card .title-field:hover,
.result-card-inner .title-field:hover {
  color: #000061 !important;
  text-decoration: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* Card body */
.result-card-inner .slds-card__body {
  padding: 0 !important;
  margin-top: 4px !important;
}

/* Summary label and text */
.text-field-label {
  display: none !important;
}

.text-field-value {
  font-family: 'Calibre', sans-serif !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 24px !important;
  color: #6B7280 !important;
  margin: 0 !important;
}

/* Truncatable text container */
dxp_crm_search-truncatable-text,
.text-field-truncate {
  display: block !important;
}

/* ========================================================================================
   MOBILE HEADER - Add "Search results" heading
   ======================================================================================== */

/* Mobile header - add "Search results" heading that doesn't exist in mobile component */
dxp_crm_search-mobile-header {
  display: block !important;
  width: 100% !important;
  max-width: 900px !important;
  margin: 150px auto 0 auto !important; /* Top margin + centered like desktop */
  padding: 0 !important;
}

/* Add "Search results" heading before mobile header content */
dxp_crm_search-mobile-header::before {
  content: "Search results" !important;
  display: block !important;
  font-family: var(--dxp-s-header-font-family, 'Axiforma-Light', sans-serif) !important;
  font-size: 56px !important; /* Same as desktop */
  font-weight: 300 !important;
  line-height: 68px !important;
  letter-spacing: -2px !important;
  color: #13131F !important;
  text-align: left !important;
  margin-bottom: 16px !important;
}

/* Style the mobile header container below the heading */
dxp_crm_search-mobile-header .header-container {
  padding-top: 0 !important; /* Remove default top padding */
}

/* ========================================================================================
   MOBILE RESPONSIVE DESIGN
   ======================================================================================== */

@media only screen and (max-width: 768px) {
  /* Reduce horizontal padding for tablets, keep centered - FORCE */
  dxp_crm_search-scoped-results-container.scoped-results-container,
  dxp_crm_search-scoped-results-container .scoped-results-container,
  div.scoped-results-container,
  .scoped-results-container {
    padding: 0 32px !important;
    margin: 0 auto !important; /* Keep centered */
  }
  
  /* Reduce top margin for header-meta on tablets (desktop view) */
  dxp_crm_search-header-meta,
  dxp_crm_search-header-meta.lwc-622rpr4hecm-host {
    margin-top: 150px !important; /* Responsive: 150px on tablet (proportional to 250px desktop) */
    margin-left: auto !important; /* Keep centered */
    margin-right: auto !important;
  }
  
  /* Adjust mobile header for tablets */
  dxp_crm_search-mobile-header {
    margin-top: 120px !important; /* Tablet spacing */
  }
  
  /* Mobile header heading - adjust size for tablets */
  dxp_crm_search-mobile-header::before {
    font-size: 36px !important;
    line-height: 44px !important;
    letter-spacing: -1px !important;
  }
  
  /* Reduce top spacing for tablets, keep centered - FORCE */
  dxp_crm_search-scoped-results-container div.results-header,
  dxp_crm_search-scoped-results-container .results-header,
  article.slds-card div.results-header,
  .results-header,
  div.results-header {
    padding: 0 0 20px 0 !important;
    margin: 0 auto !important; /* Keep centered */
  }
  
  /* Keep card body centered on tablets - FORCE */
  article.slds-card .slds-card__body.slds-grow,
  .slds-card__body.slds-grow,
  div.slds-card__body.slds-grow {
    margin: 0 auto !important; /* Keep centered */
  }
  
  /* Mobile header - ONLY for main header - ENSURE VISIBILITY - MAX SPECIFICITY */
  dxp_crm_search-header-meta h2.slds-card__header-title::before,
  dxp_crm_search-header-meta .slds-card__header-title::before,
  dxp_crm_search-header-meta h2.slds-text-heading_medium::before {
    content: "Search results" !important;
    font-size: 56px !important; /* Same as desktop */
    line-height: 68px !important;
    letter-spacing: -2px !important;
    display: block !important; /* Ensure it's visible */
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    clip: auto !important;
    color: #13131F !important;
    font-weight: 300 !important;
  }
  
  /* Ensure header element is visible on mobile - MAX SPECIFICITY */
  dxp_crm_search-header-meta h2.slds-card__header-title,
  dxp_crm_search-header-meta .slds-card__header-title,
  dxp_crm_search-header-meta h2.slds-text-heading_medium {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    clip: auto !important;
    position: static !important;
  }
  
  /* Mobile results count and sort - vertical stack */
  dxp_crm_search-header-meta .slds-text-body--small,
  dxp_crm_search-header-meta .slds-text-color--weak {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-top: 12px !important;
  }
  
  /* Mobile results count */
  .header-meta__count-label,
  span.header-meta__count-label {
    font-size: 16px !important;
    line-height: 22px !important;
    width: 100% !important;
  }
  
  /* HIDE Sort by and dropdown on mobile */
  dxp_crm_search-header-meta lightning-button-menu,
  dxp_crm_search-header-meta lightning-button-menu button,
  lightning-button-menu,
  lightning-button-menu button {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    width: 0 !important;
    height: 0 !important;
  }
  
  /* HIDE filter icons on mobile */
  search_results-results-header-filters,
  .results-header-filters,
  .search-filters-icon,
  .filter-icon,
  .sort-icon,
  lightning-button-icon.sort-icon,
  lightning-button-icon[data-test-id="filter-button"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
  }
  
  /* HIDE "Sorted by" label and value on mobile */
  .mobileHeader__sort-label-container,
  .mobileHeader__sort-label,
  .mobileHeader__sort-label-value {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
  }
  
  /* Keep count visible but hide sort elements */
  .count-sort-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  
  .count-label {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  /* Mobile cards */
  .result-card-inner {
    padding: 20px !important;
    margin-bottom: 12px !important;
  }
  
  /* Mobile card title - prevent cutoff */
  search_results-result-stencil-card .title-field,
  .result-card-inner .title-field,
  .title-field {
    font-size: 18px !important;
    line-height: 24px !important;
    white-space: normal !important; /* Allow text wrapping */
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
  }
  
  /* Mobile card body */
  .text-field-value {
    font-size: 16px !important;
    line-height: 24px !important;
    word-wrap: break-word !important;
  }
}

@media only screen and (max-width: 576px) {
  /* Reduce horizontal padding for small phones, keep centered - FORCE */
  dxp_crm_search-scoped-results-container.scoped-results-container,
  dxp_crm_search-scoped-results-container .scoped-results-container,
  div.scoped-results-container,
  .scoped-results-container {
    padding: 0 20px !important;
    margin: 0 auto !important; /* Keep centered */
  }
  
  /* Reduce top margin for header-meta on small phones (desktop view) */
  dxp_crm_search-header-meta,
  dxp_crm_search-header-meta.lwc-622rpr4hecm-host {
    margin-top: 100px !important; /* Responsive: 100px on mobile (proportional to 250px desktop) */
    margin-left: auto !important; /* Keep centered */
    margin-right: auto !important;
  }
  
  /* Adjust mobile header for small phones */
  dxp_crm_search-mobile-header {
    margin-top: 80px !important; /* Mobile spacing */
  }
  
  /* Mobile header heading - adjust size for small phones */
  dxp_crm_search-mobile-header::before {
    font-size: 32px !important;
    line-height: 40px !important;
    letter-spacing: -1px !important;
  }
  
  /* Reduce top spacing for small phones, keep centered - FORCE */
  dxp_crm_search-scoped-results-container div.results-header,
  dxp_crm_search-scoped-results-container .results-header,
  article.slds-card div.results-header,
  .results-header,
  div.results-header {
    padding: 0 0 16px 0 !important;
    margin: 0 auto !important; /* Keep centered */
  }
  
  /* Keep card body centered on small phones - FORCE */
  article.slds-card .slds-card__body.slds-grow,
  .slds-card__body.slds-grow,
  div.slds-card__body.slds-grow {
    margin: 0 auto !important; /* Keep centered */
  }
  
  /* Small phone header - ONLY for main header - ENSURE VISIBILITY - MAX SPECIFICITY */
  dxp_crm_search-header-meta h2.slds-card__header-title::before,
  dxp_crm_search-header-meta .slds-card__header-title::before,
  dxp_crm_search-header-meta h2.slds-text-heading_medium::before {
    content: "Search results" !important;
    font-size: 56px !important; /* Same as desktop */
    line-height: 68px !important;
    letter-spacing: -2px !important;
    display: block !important; /* Ensure it's visible */
    visibility: visible !important;
    opacity: 1 !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    clip: auto !important;
    color: #13131F !important;
    font-weight: 300 !important;
  }
  
  /* Ensure header element is visible on small phones - MAX SPECIFICITY */
  dxp_crm_search-header-meta h2.slds-card__header-title,
  dxp_crm_search-header-meta .slds-card__header-title,
  dxp_crm_search-header-meta h2.slds-text-heading_medium {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    clip: auto !important;
    position: static !important;
  }
  
  /* Small phone results count */
  .header-meta__count-label,
  span.header-meta__count-label {
    font-size: 14px !important;
    line-height: 20px !important;
  }
  
  /* Small phone cards */
  .result-card-inner {
    padding: 16px !important;
  }
  
  /* Small phone card title - prevent cutoff */
  search_results-result-stencil-card .title-field,
  .result-card-inner .title-field,
  .title-field {
    font-size: 16px !important;
    line-height: 22px !important;
    white-space: normal !important; /* Allow text wrapping */
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
    display: block !important;
  }
  
  /* Small phone card body */
  .text-field-value {
    font-size: 14px !important;
    line-height: 20px !important;
    /* Limit to 3 lines */
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    word-wrap: break-word !important;
  }
}

/* ========================================================================================
   UTILITY CLASSES
   ======================================================================================== */

/* Remove any default margins/paddings that might interfere */
.scoped-results__card {
  margin: 0 !important;
  padding: 0 !important;
}

.card-display-type {
  width: 100% !important;
}

/* Ensure proper spacing in list */
lst-template-list-item-factory {
  display: block !important;
  margin-bottom: 0 !important;
}

/* ========================================
   SEARCH TERM HIGHLIGHTING - ENABLED
   ======================================== */

/* Show yellow highlighting on search terms - all possible selectors and methods */
mark,
.highlight,
.highlighted,
.search-highlight,
em.highlight,
strong.highlight,
span.highlight,
search_results-result-stencil-card mark,
search_results-result-stencil-card .highlight,
search_results-result-stencil-card em,
.result-card-inner mark,
.result-card-inner .highlight,
.title-field mark,
.title-field .highlight,
.title-field em,
.text-field-value mark,
.text-field-value .highlight,
.text-field-value em,
dxp_crm_search-truncatable-text mark,
dxp_crm_search-truncatable-text .highlight,
dxp_crm_search-truncatable-text em,
h3.slds-card__header-title mark,
h3.slds-card__header-title .highlight,
h3.slds-card__header-title em,
a.title-field mark,
a.title-field .highlight,
a.title-field em,
dd.text-field-value mark,
dd.text-field-value .highlight,
dd.text-field-value em {
  background-color: #FFEB3B !important; /* Bright yellow */
  color: #101820 !important; /* Dark text for contrast */
  font-weight: 600 !important;
  font-style: normal !important; /* Override italic from em */
  padding: 0 3px !important;
  border-radius: 3px !important;
  display: inline !important;
  opacity: 1 !important;
  visibility: visible !important;
  text-decoration: none !important;
  box-shadow: none !important;
  border: none !important;
}

/* Ensure mark elements are visible in all states */
mark:hover,
mark:focus,
mark:active,
.highlight:hover,
.highlight:focus,
.highlight:active,
em:hover,
em:focus,
em:active {
  color: #101820 !important;
}

/* Force visibility for any potential highlighting wrapper */
[data-highlight],
[data-search-highlight],
.slds-text-color_weak mark,
.slds-text-color_weak .highlight,
.slds-text-color_weak em {
  background-color: #FFEB3B !important;
  color: #101820 !important;
  font-weight: 600 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* ========================================
   NO RESULTS IMAGE - HIDE IT
   ======================================== */

/* Hide "no results found" image */
figure.slds-p-bottom--xx-large img[src*="no-results"],
figure.slds-p-bottom--xx-large img[src*="/img/search/"],
figure img[alt*="no result"],
figure img[alt*="No result"],
.no-results figure img {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  position: absolute !important;
  left: -9999px !important;
  width: 0 !important;
  height: 0 !important;
}

/* Hide the entire figure container for no results */
figure.slds-p-bottom--xx-large:has(img[src*="no-results"]),
figure.slds-p-bottom--xx-large:has(img[src*="/img/search/"]),
.no-results figure.slds-p-bottom--xx-large,
.no-results figure {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  position: absolute !important;
  left: -9999px !important;
}

/* Adjust no-results container spacing and remove borders */
.no-results,
.card-display-type.no-results,
search_results-no-results,
.no-results.slds-page-header,
.slds-page-header.no-results {
  padding: 40px 20px !important;
  text-align: center !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* Remove borders from the card container inside no-results */
.card-display-type,
.card-display-type.lwc-4vlbhvdj3e6,
search_results-no-results.lwc-4vlbhvdj3e6 {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* Style the no-results text and hide "in Knowledge" - Target the h3 element */
.no-results h3.dxp-text-heading-large,
.no-results h3.textBlock_desktopTabletMobile,
h3.lwc-4rt99a8doqk.dxp-text-heading-large,
dxp_base-text-block h3.dxp-text-heading-large {
  position: relative !important;
  font-family: var(--dxp-s-header-font-family, 'Axiforma-Light', sans-serif) !important;
  font-size: 32px !important;
  font-weight: 400 !important;
  line-height: 40px !important;
  color: transparent !important; /* Hide original text */
  margin-top: 0 !important;
  margin-bottom: 16px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-indent: -9999px !important; /* Extra hiding method */
}

/* Show simplified message without "in Knowledge" */
.no-results h3.dxp-text-heading-large::before,
.no-results h3.textBlock_desktopTabletMobile::before,
h3.lwc-4rt99a8doqk.dxp-text-heading-large::before,
dxp_base-text-block h3.dxp-text-heading-large::before {
  content: "No search results found" !important;
  display: block !important;
  position: absolute !important;
  left: 50% !important;
  top: 0 !important;
  transform: translateX(-50%) !important; /* Center the text */
  font-family: var(--dxp-s-header-font-family, 'Axiforma-Light', sans-serif) !important;
  font-size: 32px !important;
  font-weight: 400 !important;
  line-height: 40px !important;
  color: #13131F !important;
  white-space: normal !important;
  text-indent: 0 !important;
  width: 100% !important;
  text-align: center !important;
}

