/* 🔍 Wrapper */
.legrand-search-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

#legrand-global-search-form {
  max-width: 90% !important;
  padding: 0 !important;
}

/* 🔍 Input */
.legrand-global-search-input {
  width: 100% !important;
  padding: 2px 10px;
  border: none !important;
  border-radius: 0px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 9;
  right: 0 !important;
  background-color: transparent !important;
}

.legrand-global-search-input:focus {
  z-index: 999;
  outline: none;
}

/* 🔍 Icon / X toggle */
.legrand-search-icon {
  display: block !important;
  width: 30px;
  height: 18px;
  background: url(../css/img/search-solid.svg) no-repeat center center;
  background-size: contain;
  cursor: pointer;
  top: 6px;
  /* right: 15px !important; */
  position: absolute;
  z-index: 9999;
  right: 0;
}

.legrand-search-close {
  display: block !important;
  width: 30px;
  height: 20px;
  background: url(../css/img/xmark-solid-full.svg) no-repeat center center;
  background-size: contain;
  cursor: pointer;
  top: 6px;
  /* left: 150% !important; */
  position: absolute;
  z-index: 10005;
  right: 0;
}

.legrand-search-icon.active {
  display: none !important;
}

/* 🟦 Overlay */
#legrand-search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  /* dark tint */
  z-index: 99;
  display: none;
}

header.legranddpc {
  z-index: 100 !important;
}

/* 🟦 Grid Layout */
.legrand-suggestion-grid {
  display: flex;
  justify-content: end;
  flex-wrap: wrap;
}

.legrand-suggestion-grid .column {
  flex: 1;
  padding: 10px;
  min-width: 180px;
}

.legrand-suggestion-grid h4 {
  font-size: 14px;
  margin-bottom: 5px;
}

.legrand-suggestion-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.legrand-suggestion-grid li {
  margin: 3px 0;
}

#block-legranddpc-main-menu .sections {
  align-items: center !important;
}

@media (max-width: 768px) {
  .legrand-suggestion-grid {
    flex-direction: column;
  }
}

.legrand-search-title {
  color: #001e73 !important;
  text-decoration: none !important;
  font-size: 16px;
}

.legrand-search-icon-download {
  display: inline-block;
  width: 25px;
  height: 50px;
  background: url("../css/img/download-regular-full.svg") no-repeat center center;
  background-size: contain;
}

.product-search-title-custom {
  width: 100% !important;
}

/* Force dropdown to float above form wrappers */
.legrand-suggestion-dropdown {
  position: absolute;
  /* take it out of parent flow */
  top: 100%;
  /* directly under the input */
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  max-height: 300px;
  overflow-y: auto;
  z-index: 10000;
  /* always above */
  display: none;
}

/* Ensure wrapper allows absolute positioning */
.legrand-search-wrapper {
  position: relative;
  padding-left: 20px;
}

/*  */

/* Wrapper must allow absolute positioning */
.legrand-global-search-wrapper {
  position: relative;
}

/* Dropdown aligned under input */
#legrand-search-suggestion-dropdown {
  /* position: absolute; */
  top: 100%;
  /* exactly below input */
  left: 5%;
  /* align with input’s left */
  padding: 2% 5%;
  width: 100%;
  /* same width as input column */
  max-width: 100%;
  /* don’t overflow */
  background: #fff;
  border: 1px solid #ccc;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  max-height: 400px;
  overflow-y: auto;
}

/* Blog titles should not get cut off */
#legrand-search-suggestion-dropdown .legrand-search-title {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: initial !important;
}

.legrand-close-btn {
  border: 0;
  font-size: x-large;
}

/*search styles  */

/* search full width */

#block-legranddpc-main-menu .sections.search-active {
  grid-template-columns: auto !important;
}

/* suggestion box styles */

.legrand-suggestion-grid .col-4,
.legrand-suggestion-grid .col-3 {
  border-right: 1px solid #e1e1e1;
  text-align: start;
  padding: 0 30px;
}

.legrand-suggestion-grid .col-4:last-child,
.legrand-suggestion-grid .col-3:last-child {
  border-right: none;
}

.legrand-suggestion-grid h4 {
  display: block;
  /* padding: 0 30px; */
  margin-bottom: 32px;
  color: #1b2d3a;
  font-size: 1rem;
  font-weight: 700;
  font-family: Arial, Helvetica, sans-serif;
}

.legrand-suggestion-grid .product-meta a {
  color: #001e73 !important;
  font-weight: 700;
  text-transform: none;
  margin-bottom: 11px;
}

.legrand-suggestion-grid li a {
  text-transform: none;
}

.legrand-suggestion-grid ul {
  display: flex !important;
  flex-direction: column;
  gap: 30px;
}

.legrand-suggestion-grid ul .product-item {
  margin-bottom: 20px;
}

.legrand-suggestion-grid .col-4 .resource-item-search-li,
.legrand-suggestion-grid .col-3 .resource-item-search-li {
  display: flex !important;
  gap: 20px;
}

.legrand-suggestion-grid .product-meta .category {
  margin-top: 12px;
  font-size: 1rem !important;
  font-weight: 400 !important;
}

/* .lgs-search-icon-wrapper {
  width: 50px;
  height: 50px;
  position: absolute;
  right: 0px;
  top: 0px;
} */

@media (max-width: 768px) {

  .legrand-suggestion-grid .col-4,
  .legrand-suggestion-grid .col-3 {
    width: 100%;
    border-right: none;
  }

  /* header #block-legranddpc-main-menu .nav,
  .search-trigger {
    display: none;
  } */

  header.legranddpc.fixed-mini {
    height: 110px !important;
  }

  #legrand-global-search-form {
    display: none;
    max-width: 100% !important;
  }

  .legrand-global-search-form {
    margin-top: 40px;
    display: none;
  }
  #block-legranddpc-main-menu .wrap {
    position: inherit !important;
  }
  #legrand-global-search-wrapper #edit-search-col {
    border: none !important;
  }
  .menu-close {
      left: inherit !important;
      right: 5px !important;
      position: fixed !important;
      top: 16px !important;
  }
  #legrand-global-search-wrapper {
    position: relative;
    border-radius: 25px;
    box-shadow: 0 2px 5px;
    border: 1px solid #000;
  }
  body {
    overflow-x: hidden !important;
  }
  .legrand-global-search-input {
    height: 16px;
  }
  .legrand-search-icon, .legrand-search-close {
    top: 3px;
    right: 15px !important;
  }
  #legrand-global-search-form .row {
  margin-top: 0 !important;
}
}

@media only screen and (min-width: 767px) {
  header #block-legranddpc-main-menu .sections {
    display: grid !important;
  }

}

@media only screen and (min-width: 992px) {
  .sections.search-active #edit-search-row {
    padding-left: 200px;
    padding-right: 60px;
    margin-top: 12px !important;
  }
}

/* #block-legranddpc-main-menu .wrap {
  max-width: 100% !important;
} */

.legrand-suggestion-grid .legrand-close-btn {
  display: none;
}

#legrand-global-search-wrapper #edit-search-col {
  border: 1px solid #000;
  position: relative;
  padding-left: 0;
  background: rgba(255, 255, 255, 0.3);
  height: 32px;
}

#edit-search-col .js-form-item {
  max-width: 100% !important;
  padding: 0 !important;
}

#legrand-global-search-form .row {
  width: 100% !important;
  margin: 0px !important;
  margin-top: 15px !important;
}

#legrand-search-suggestion-dropdown li {
  font-size: 14px !important;
  /* text-transform: lowercase !important; */
}

.resource-item-search-li img {
  width: 30px !important;
}
@supports (-webkit-touch-callout: none) {
  .legrand-global-search-input,
  #block-legranddpc-main-menu form input {
    font-size: 16px !important;
  }
}

@media (max-width: 768px) {
  .legrand-suggestion-grid .row h4 {
    margin-top: 20px !important;
  }
}