/* TBP Product Search – pirx lookalike (FiboSearch visual parity) */
.tbp-ps-wrapp {
  --tbp-ps-blue: #1e4bae;
  --tbp-ps-pink: #e34fa5;
  --tbp-ps-bg: #f9f9f9;
  position: relative;
  line-height: 1;
  display: block;
  max-width: 600px;
  width: 100%;
  min-width: 180px;
  margin: 0 auto;
  box-sizing: border-box;
  z-index: 60; /* above .tbp-fab (50) */
}
.tbp-ps-wrapp *,
.tbp-ps-wrapp *::before,
.tbp-ps-wrapp *::after {
  box-sizing: border-box;
}
.tbp-ps-search-icon {
  display: none;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  width: 22px;
  height: 22px;
  cursor: pointer;
  color: var(--tbp-ps-blue);
  line-height: 0;
}
.tbp-ps-search-icon .tbp-ps-ico-magnifier {
  width: 20px;
  height: 20px;
  display: block;
}
.tbp-ps-search-icon .tbp-ps-ico-magnifier path {
  fill: var(--tbp-ps-blue);
}
.tbp-ps-search-form {
  width: 100%;
  margin: 0;
}
.tbp-ps-sf-inner {
  position: relative;
  background: #fff;
  padding: 0;
  border-radius: 10px;
}
.tbp-ps-search-input {
  width: 100%;
  padding: 13px 40px 13px 48px;
  line-height: 24px;
  font-size: 17px;
  font-family: inherit;
  border: 2px solid var(--tbp-ps-pink);
  border-radius: 30px;
  background-color: var(--tbp-ps-bg);
  color: var(--tbp-ps-blue);
  height: auto;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color 80ms ease, border-color 80ms ease;
}
.tbp-ps-search-input::placeholder {
  color: var(--tbp-ps-blue);
  opacity: 0.3;
}
.tbp-ps-search-input:hover,
.tbp-ps-search-input:focus {
  background-color: #fff;
  border-color: var(--tbp-ps-pink);
  color: var(--tbp-ps-blue);
  box-shadow: none;
}
.tbp-ps-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.tbp-ps-submit-ico {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tbp-ps-submit-ico .tbp-ps-ico-magnifier path {
  fill: var(--tbp-ps-blue);
}
.tbp-ps-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--tbp-ps-blue);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.tbp-ps-clear[hidden] {
  display: none !important;
}
.tbp-ps-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 0 0 8px 8px;
  max-height: min(70vh, 420px);
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.tbp-ps-suggestions[hidden] {
  display: none !important;
}
.tbp-ps-suggestion {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  text-decoration: none;
  color: #222;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}
.tbp-ps-suggestion:last-child {
  border-bottom: 0;
}
.tbp-ps-suggestion:hover,
.tbp-ps-suggestion.is-active {
  background: #f5f7fc;
}
.tbp-ps-suggestion__thumb {
  flex: 0 0 48px;
  width: 48px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.tbp-ps-suggestion__thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 !important;
}
.tbp-ps-suggestion__body {
  flex: 1 1 auto;
  min-width: 0;
}
.tbp-ps-suggestion__title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: #1a1a1a;
  margin: 0 0 4px;
}
.tbp-ps-suggestion__sku {
  display: block;
  font-size: 12px;
  color: #777;
  margin-bottom: 4px;
}
.tbp-ps-suggestion__price {
  font-size: 13px;
  line-height: 1.3;
}
.tbp-ps-suggestion__price .tbp-price {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}
.tbp-ps-empty,
.tbp-ps-more {
  padding: 12px 14px;
  font-size: 14px;
  color: #555;
}
.tbp-ps-more a {
  color: var(--tbp-ps-blue);
  font-weight: 600;
  text-decoration: none;
}
.tbp-ps-overlay-close {
  display: none;
}
.tbp-ps-wrapp.is-loading .tbp-ps-submit-ico {
  opacity: 0.45;
}
.tbp-ps-wrapp.is-loading .tbp-ps-submit-ico::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--tbp-ps-blue);
  border-right-color: transparent;
  border-radius: 50%;
  animation: tbp-ps-spin 0.6s linear infinite;
}
@keyframes tbp-ps-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Desktop: full bar (icon-flexible "loaded") */
@media (min-width: 901px) {
  .tbp-ps-layout-icon-flexible .tbp-ps-search-icon {
    display: none;
  }
  .tbp-ps-layout-icon-flexible .tbp-ps-search-form {
    display: block;
    opacity: 1;
  }
}

/* Mobile / tablet: icon expands to overlay (matches FiboSearch icon-flexible) */
@media (max-width: 900px) {
  .tbp-ps-layout-icon-flexible {
    max-width: 22px;
    min-width: 22px;
    width: 22px;
  }
  .tbp-ps-layout-icon-flexible .tbp-ps-search-icon {
    display: block;
  }
  .tbp-ps-layout-icon-flexible .tbp-ps-search-form {
    display: none;
  }
  .tbp-ps-layout-icon-flexible.is-open {
    position: static;
    max-width: none;
    width: auto;
    min-width: 0;
  }
  .tbp-ps-layout-icon-flexible.is-open .tbp-ps-search-icon {
    display: none;
  }
  .tbp-ps-layout-icon-flexible.is-open .tbp-ps-search-form {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 100050;
    padding: 12px 12px 8px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
  }
  .tbp-ps-layout-icon-flexible.is-open .tbp-ps-suggestions {
    position: fixed;
    left: 0;
    right: 0;
    top: 72px;
    max-height: calc(100vh - 72px);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .tbp-ps-layout-icon-flexible.is-open .tbp-ps-overlay-close {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 100040;
    background: rgba(0, 0, 0, 0.35);
    border: 0;
    color: transparent;
    font-size: 0;
    cursor: pointer;
  }
  body.tbp-ps-overlay-on {
    overflow: hidden;
  }
}

/* Keep suggestions above header FAB "Nous trouver" */
.tbp-ps-wrapp.is-open,
.tbp-ps-wrapp.is-suggesting {
  z-index: 100060;
}
.tbp-ps-wrapp.is-suggesting .tbp-ps-suggestions,
.tbp-ps-wrapp.is-open .tbp-ps-suggestions {
  z-index: 100061;
}
/* Hide header action buttons under search overlay/suggestions (mobile) */
body.tbp-ps-overlay-on .tbp-fab,
body.tbp-ps-suggesting .tbp-fab,
body.tbp-ps-overlay-on .tbp-footer-line,
body.tbp-ps-suggesting .tbp-footer-line,
body.tbp-ps-overlay-on .tbp-menu-compact,
body.tbp-ps-suggesting .tbp-menu-compact,
body.tbp-ps-overlay-on .tbp-scm-accordion,
body.tbp-ps-suggesting .tbp-scm-accordion,
body.tbp-ps-overlay-on .tbp-scm-acc__toggle,
body.tbp-ps-suggesting .tbp-scm-acc__toggle,
body.tbp-ps-overlay-on .tbp-btn-contact,
body.tbp-ps-suggesting .tbp-btn-contact,
body.tbp-ps-overlay-on .tbp-menu-repair,
body.tbp-ps-suggesting .tbp-menu-repair {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
