/**
 * FiboSearch — barre simple, pro, responsive (source unique)
 */

/* Annule la largeur max admin FiboSearch (260px) — sauf desktop header */
.dgwt-wcas-search-wrapp {
  max-width: 100% !important;
}

@media (min-width: 768px) {
  .ar-pdf-search-desktop .dgwt-wcas-search-wrapp {
    max-width: clamp(190px, 20vw, 270px) !important;
  }
}

html.dgwt-wcas-overlay-mobile-on .dgwt-wcas-search-wrapp,
html.dgwt-wcas-overlay-mobile-on .dgwt-wcas-om-bar .dgwt-wcas-search-wrapp,
html.dgwt-wcas-overlay-mobile-on .dgwt-wcas-om-bar .dgwt-wcas-search-wrapp-mobile,
.dgwt-wcas-overlay-mobile .dgwt-wcas-search-wrapp,
.dgwt-wcas-overlay-mobile .dgwt-wcas-search-wrapp-mobile {
  max-width: none !important;
  width: 100% !important;
}

/* ========== CONTENEUR HEADER ========== */
.ar-pdf-header .ar-pdf-row1 {
  position: relative;
  z-index: 12;
}

.ar-pdf-header .ar-pdf-row2 {
  position: relative;
  z-index: 4;
}

.ar-pdf-tools-col,
.ar-pdf-tools-inner,
.ar-pdf-tools-col > .e-con-inner,
.ar-pdf-search,
.ar-pdf-search-desktop,
.ar-pdf-search-mobile {
  overflow: visible !important;
  min-width: 0;
}

.ar-pdf-tools-col,
.ar-pdf-tools-inner,
.ar-pdf-search {
  position: relative;
  z-index: 20;
}

.ar-pdf-search .dgwt-wcas-search-wrapp {
  position: relative;
  z-index: 60;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  line-height: 1;
}

.ar-pdf-search .dgwt-wcas-search-wrapp.dgwt-wcas-open,
.ar-pdf-search .dgwt-wcas-open .dgwt-wcas-search-wrapp {
  z-index: 100120;
}

/* ========== CHAMP PILL (desktop + overlay mobile) ========== */
.ar-pdf-search .dgwt-wcas-search-form {
  position: static !important;
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
}

.ar-pdf-search .dgwt-wcas-sf-wrapp {
  display: flex !important;
  align-items: center !important;
  flex-direction: row-reverse !important;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 3px;
  background: var(--ar-cream, #faf7f4);
  border: 1px solid #ece5dd;
  border-radius: 999px;
  overflow: visible;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.ar-pdf-search .dgwt-wcas-sf-wrapp::before,
.ar-pdf-search .dgwt-wcas-sf-wrapp::after {
  display: none !important;
  content: none !important;
}

.ar-pdf-search .dgwt-wcas-sf-wrapp:focus-within,
.ar-pdf-search .dgwt-wcas-open .dgwt-wcas-sf-wrapp {
  border-color: var(--ar-red, #8b1e1e);
  box-shadow: 0 4px 16px rgba(139, 30, 30, 0.1);
}

.ar-pdf-search .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input,
.ar-pdf-search .dgwt-wcas-search-input,
.ar-pdf-search .dgwt-wcas-no-submit .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
  flex: 1 1 auto;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 38px !important;
  min-height: 38px !important;
  margin: 0 !important;
  padding: 0 10px 0 14px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: 0 !important;
  font-family: "Lato", sans-serif !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #1a1a1a !important;
  line-height: 38px !important;
  -webkit-appearance: none;
  appearance: none;
}

.ar-pdf-search .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input::placeholder {
  color: #9a9186 !important;
  font-style: normal !important;
  opacity: 1;
}

/* Loupe : annule le positionnement absolute du plugin FiboSearch */
.ar-pdf-search .dgwt-wcas-ico-magnifier,
.ar-pdf-search .dgwt-wcas-no-submit .dgwt-wcas-ico-magnifier,
.ar-pdf-search .dgwt-wcas-sf-wrapp .dgwt-wcas-ico-magnifier {
  position: relative !important;
  inset: auto !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  flex: 0 0 36px;
  order: -1;
  display: block !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  margin: 0 !important;
  padding: 8px !important;
  border-radius: 50%;
  background: var(--ar-red, #8b1e1e);
  opacity: 1 !important;
  box-sizing: border-box;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(139, 30, 30, 0.2);
  transform: none !important;
}

.ar-pdf-search .dgwt-wcas-ico-magnifier path {
  fill: #fff !important;
}

.ar-pdf-search .dgwt-wcas-search-icon-arrow {
  display: none !important;
}

/* ========== DESKTOP : barre compacte dans le header ========== */
@media (min-width: 768px) {
  .ar-pdf-search-desktop .dgwt-wcas-search-wrapp {
    width: clamp(190px, 20vw, 270px);
    max-width: clamp(190px, 20vw, 270px);
  }

  .ar-pdf-search-desktop .dgwt-wcas-layout-icon-flexible-loaded .dgwt-wcas-search-icon,
  .ar-pdf-search-desktop .dgwt-wcas-layout-icon-flexible .dgwt-wcas-search-icon {
    display: none !important;
  }

  /* Annule le dropdown absolute du plugin (min-width 500px) */
  html:not(.dgwt-wcas-overlay-mobile-on) .ar-pdf-search-desktop .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon .dgwt-wcas-search-form,
  html:not(.dgwt-wcas-overlay-mobile-on) .ar-pdf-search-desktop .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon-open .dgwt-wcas-search-form,
  .ar-pdf-search-desktop .dgwt-wcas-open .dgwt-wcas-search-form {
    position: static !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  /* Résultats : panneau sous la barre, au-dessus du menu */
  .ar-pdf-search-desktop .dgwt-wcas-suggestions-wrapp {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    width: min(360px, calc(100vw - 32px)) !important;
    max-width: min(360px, calc(100vw - 32px)) !important;
    margin: 0 !important;
    max-height: min(50vh, 380px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    z-index: 100130 !important;
  }
}

/* ========== MOBILE : icône compacte alignée panier / compte ========== */
@media (max-width: 767px) {
  .ar-pdf-search-mobile,
  .ar-pdf-search-mobile.e-con,
  .ar-pdf-search-mobile > .e-con-inner,
  .ar-pdf-search-mobile .elementor-widget,
  .ar-pdf-search-mobile .elementor-widget-container,
  .ar-pdf-search-mobile .elementor-shortcode {
    position: relative;
    z-index: 30;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
  }

  .ar-pdf-search-mobile .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 0 !important;
    z-index: 100120;
  }

  .ar-pdf-search-mobile .dgwt-wcas-icon-preloader,
  .ar-pdf-search-mobile .dgwt-wcas-search-icon-arrow {
    display: none !important;
  }

  .ar-pdf-search-mobile a.dgwt-wcas-search-icon {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    color: #1a1a1a !important;
    padding: 0 !important;
    margin: 0 !important;
    transform: none !important;
    vertical-align: middle !important;
    transition: opacity 0.2s ease;
  }

  .ar-pdf-search-mobile a.dgwt-wcas-search-icon:hover,
  .ar-pdf-search-mobile a.dgwt-wcas-search-icon:focus {
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
    opacity: 0.72;
  }

  .ar-pdf-search-mobile svg.dgwt-wcas-ico-magnifier-handler {
    display: block !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
    margin: 0 !important;
  }

  .ar-pdf-search-mobile svg.dgwt-wcas-ico-magnifier-handler path {
    fill: #1a1a1a !important;
  }

  /* Fermé : pas de barre pill dans le header */
  .ar-pdf-search-mobile .dgwt-wcas-search-wrapp:not(.dgwt-wcas-layout-icon-open) .dgwt-wcas-search-form,
  .ar-pdf-search-mobile .dgwt-wcas-search-wrapp:not(.dgwt-wcas-layout-icon-open) .dgwt-wcas-suggestions-wrapp,
  .ar-pdf-search-mobile .dgwt-wcas-search-wrapp:not(.dgwt-wcas-layout-icon-open) .dgwt-wcas-sf-wrapp {
    display: none !important;
  }
}

/* ========== OVERLAY MOBILE PLEIN ÉCRAN ========== */
html.dgwt-wcas-overlay-mobile-on {
  overflow: hidden !important;
}

html.dgwt-wcas-overlay-mobile-on body {
  overflow: hidden !important;
}

.dgwt-wcas-overlay-mobile {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100000 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  background: #fff !important;
  display: flex !important;
  flex-direction: column !important;
}

.dgwt-wcas-overlay-mobile .dgwt-wcas-om-bar {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 52px !important;
  height: auto !important;
  padding: 8px 10px !important;
  margin: 0 !important;
  background: #fff !important;
  border-bottom: 1px solid #ece5dd !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  flex-shrink: 0;
}

.dgwt-wcas-overlay-mobile .dgwt-wcas-om-bar button.dgwt-wcas-om-return,
.dgwt-wcas-overlay-mobile .dgwt-wcas-om-bar button.dgwt-wcas-om-return:hover,
.dgwt-wcas-overlay-mobile .dgwt-wcas-om-bar button.dgwt-wcas-om-return:focus,
.dgwt-wcas-overlay-mobile .dgwt-wcas-om-bar button.dgwt-wcas-om-return:active {
  position: relative !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid #ece5dd !important;
  border-radius: 50% !important;
  background: #faf7f4 !important;
  box-shadow: none !important;
  flex-shrink: 0 !important;
}

.dgwt-wcas-overlay-mobile .dgwt-wcas-om-bar .dgwt-wcas-om-return svg {
  position: absolute !important;
  inset: 0 !important;
  margin: auto !important;
  width: 16px !important;
  height: 16px !important;
  fill: #8b1e1e !important;
}

.dgwt-wcas-overlay-mobile .dgwt-wcas-om-bar .dgwt-wcas-search-wrapp-mobile,
.dgwt-wcas-overlay-mobile .dgwt-wcas-search-wrapp-mobile {
  flex: 1 1 auto !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
}

.dgwt-wcas-overlay-mobile .dgwt-wcas-search-form {
  width: 100% !important;
  max-width: 100% !important;
}

.dgwt-wcas-overlay-mobile .dgwt-wcas-sf-wrapp {
  display: flex !important;
  align-items: center !important;
  flex-direction: row-reverse !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 40px !important;
  padding: 2px !important;
  background: #faf7f4 !important;
  border: 1px solid #ece5dd !important;
  border-radius: 999px !important;
}

.dgwt-wcas-overlay-mobile .dgwt-wcas-ico-magnifier,
.dgwt-wcas-overlay-mobile .dgwt-wcas-no-submit .dgwt-wcas-ico-magnifier {
  position: relative !important;
  inset: auto !important;
  flex: 0 0 32px !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  padding: 7px !important;
  opacity: 1 !important;
  box-shadow: none !important;
  border-radius: 50% !important;
  background: var(--ar-red, #8b1e1e) !important;
}

.dgwt-wcas-overlay-mobile .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
  height: 36px !important;
  min-height: 36px !important;
  line-height: 36px !important;
  font-size: 16px !important;
  padding: 0 12px 0 10px !important;
  border: 0 !important;
  background: transparent !important;
}

/* Résultats injectés dans body (desktop) : toujours au-dessus du header/menu */
body > .dgwt-wcas-suggestions-wrapp {
  z-index: 100130 !important;
}

/* Overlay mobile : liste pleine largeur sous la barre */
html.dgwt-wcas-overlay-mobile-on .dgwt-wcas-suggestions-wrapp {
  position: absolute !important;
  top: 52px !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  flex: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  margin: 0 !important;
  padding: 0 0 24px !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #fff !important;
  -webkit-overflow-scrolling: touch;
}

/* ========== RÉSULTATS ========== */
.dgwt-wcas-details-wrapp {
  display: none !important;
}

/* Dropdown desktop header uniquement */
@media (min-width: 768px) {
  .ar-pdf-search-desktop .dgwt-wcas-suggestions-wrapp {
    border: 1px solid #ece5dd !important;
    border-radius: 12px !important;
    box-shadow: 0 16px 40px rgba(26, 22, 18, 0.12) !important;
    overflow: hidden !important;
    background: #fff !important;
    padding: 4px 0 !important;
  }
}

.dgwt-wcas-suggestion {
  padding: 11px 14px !important;
  border-bottom: 1px solid #f3ece4 !important;
  font-family: "Lato", sans-serif !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
}

/* Mobile overlay : lignes produit lisibles, pleine largeur */
@media (max-width: 767px) {
  html.dgwt-wcas-overlay-mobile-on .dgwt-wcas-has-img .dgwt-wcas-suggestion.dgwt-wcas-suggestion-product {
    display: grid !important;
    grid-template-columns: 52px minmax(0, 1fr) auto !important;
    grid-template-areas: "thumb title price" !important;
    align-items: center !important;
    justify-content: initial !important;
    gap: 0 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 16px !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
  }

  html.dgwt-wcas-overlay-mobile-on .dgwt-wcas-suggestion-product .dgwt-wcas-si {
    grid-area: thumb !important;
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    flex: none !important;
    align-self: center !important;
  }

  html.dgwt-wcas-overlay-mobile-on .dgwt-wcas-suggestion-product .dgwt-wcas-si img {
    width: 52px !important;
    height: 52px !important;
    max-width: 52px !important;
    max-height: 52px !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: cover !important;
  }

  html.dgwt-wcas-overlay-mobile-on .dgwt-wcas-suggestion-product .dgwt-wcas-st {
    grid-area: title !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    flex: none !important;
    line-height: 1.35 !important;
  }

  html.dgwt-wcas-overlay-mobile-on .dgwt-wcas-suggestion-product .dgwt-wcas-st-title,
  html.dgwt-wcas-overlay-mobile-on .dgwt-wcas-suggestion-product .dgwt-wcas-st > span {
    display: block !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
    text-transform: none !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    line-height: 1.35 !important;
    color: #1a1a1a !important;
  }

  html.dgwt-wcas-overlay-mobile-on .dgwt-wcas-suggestion-product .dgwt-wcas-sp {
    grid-area: price !important;
    flex: none !important;
    align-self: center !important;
    white-space: nowrap !important;
    padding-left: 4px !important;
    text-align: right !important;
  }

  html.dgwt-wcas-overlay-mobile-on .dgwt-wcas-suggestion-headline {
    padding: 10px 16px 6px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    color: #8c8578 !important;
    background: #faf7f4 !important;
    border-bottom: 1px solid #f3ece4 !important;
  }

  html.dgwt-wcas-overlay-mobile-on .dgwt-wcas-suggestion.dgwt-wcas-suggestion-more,
  html.dgwt-wcas-overlay-mobile-on a.dgwt-wcas-details-more-products {
    display: block !important;
    width: 100% !important;
    padding: 14px 16px !important;
    text-align: center !important;
    font-size: 13px !important;
    border-top: 1px solid #f3ece4 !important;
  }
}

.dgwt-wcas-suggestion {
  padding: 11px 14px !important;
  border-bottom: 1px solid #f3ece4 !important;
  font-family: "Lato", sans-serif !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
}

.dgwt-wcas-suggestion:last-child {
  border-bottom: 0 !important;
}

.dgwt-wcas-suggestion:hover,
.dgwt-wcas-suggestion-selected {
  background: #faf7f4 !important;
}

.dgwt-wcas-has-img .dgwt-wcas-suggestion.dgwt-wcas-suggestion-product {
  min-height: 60px !important;
}

.dgwt-wcas-si img {
  border-radius: 8px !important;
  border: 1px solid #ece5dd !important;
  object-fit: cover !important;
}

.dgwt-wcas-st {
  font-family: "Lato", sans-serif !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: #8c8578 !important;
}

.dgwt-wcas-sp > span,
.dgwt-wcas-suggestion .woocommerce-Price-amount {
  font-weight: 700 !important;
  color: #8b1e1e !important;
}

.dgwt-wcas-suggestion-nores {
  padding: 24px 16px !important;
  text-align: center !important;
  font-family: "Lato", sans-serif !important;
  color: #6f6962 !important;
}

.dgwt-wcas-suggestion.dgwt-wcas-suggestion-more,
a.dgwt-wcas-details-more-products {
  justify-content: center !important;
  text-align: center !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #8b1e1e !important;
  text-transform: none !important;
  padding: 12px !important;
  border-top: 1px solid #f3ece4 !important;
}

a.dgwt-wcas-details-more-products:hover {
  background: #faf7f4 !important;
  text-decoration: none !important;
}
