/* =========================================================
   iccsearchengine — Frontend styles
   ========================================================= */

/* ─── Trigger (barre de recherche dans le header) ──────── */
.iccsearch-trigger {
  cursor: pointer;
}
.iccsearch-trigger form {
  pointer-events: none;
}

/* ─── Backdrop ──────────────────────────────────────────── */
.iccsearch-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99998;
  transition: opacity 0.2s;
}
.iccsearch-backdrop.is-active {
  display: block;
}

/* ─── Panneau principal ─────────────────────────────────── */
.iccsearch-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  background: #fff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.iccsearch-panel.is-active {
  transform: translateY(0);
}

/* Header du panneau */
.iccsearch-panel__header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 45px 32px;
  border-bottom: 1px solid #E8E8E8;
}

/* Logo */
.iccsearch-panel__logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.iccsearch-panel__logo img {
  max-height: 40px;
  width: auto;
}

/* Zone input */
.iccsearch-panel__input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.iccsearch-panel__icon {
  position: absolute;
  left: 14px;
  pointer-events: none;
  flex-shrink: 0;
}
.iccsearch-panel__input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  border: 1px solid #DADADA;
  border-radius: 20px;
  background: #F6F6F6;
  font-family: Inter, sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #262626;
  outline: none;
  transition: border-color 0.15s;
}
.iccsearch-panel__input:focus {
  border-color: #313B3E;
  background: #fff;
}
.iccsearch-panel__input::placeholder {
  color: #9E9E9E;
}

/* Bouton fermer */
.iccsearch-panel__close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s;
}
.iccsearch-panel__close:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* ─── Zone de résultats ─────────────────────────────────── */
.iccsearch-results {
  padding: 16px 32px 24px;
}
.iccsearch-results--hidden {
  display: none;
}
.iccsearch-results__label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 26px;
  font-style: normal;
  font-weight: 800;
  line-height: 29px;
  color: #323334;
  margin-bottom: 30px;
  padding-left: 44px;
}
.iccsearch-results__label strong {
  font-weight: 800;
  color: #323334;
}
.iccsearch-results__empty {
  font-family: Inter, sans-serif;
  font-size: 15px;
  color: #666;
  padding: 8px 0;
}

/* ─── Slider Swiper ─────────────────────────────────────── */
.iccsearch-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.iccsearch-slider-clip {
  flex: 1;
  overflow: hidden;
}

.iccsearch-results__slider {
  padding-bottom: 10px;
}
.iccsearch-results__slider .swiper-wrapper {
  align-items: stretch;
}

/* Boutons de navigation custom */
.iccsearch-nav-btn {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  width: 36px;
  height: 36px;
  background: #fff;
  border: 1px solid #DADADA;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  color: #313B3E;
  font-size: 24px;
  font-weight: 300;
  line-height: 36px;
  text-align: center;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  padding: 0 0 2px 0;
}
.iccsearch-nav-btn:hover {
  background: #f5f5f5;
}
.iccsearch-nav-btn.swiper-button-disabled {
  opacity: 0;
  pointer-events: none;
}

.iccsearch-slider-wrap--hidden .iccsearch-nav-btn {
  display: none;
}

/* ─── Carte produit dans le slider ──────────────────────── */
.iccsearch-product-slide {
  height: auto;
  width: 250px !important;
}
.iccsearch-product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  margin-bottom: 10px;
  margin-right: 5px;
  margin-left: 5px;
  padding: 0 12px 12px;
}

.iccsearch-product-card__link {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-decoration: none;
  color: inherit;
  margin: 0 -12px;
}
.iccsearch-product-card__link:hover {
  text-decoration: none;
  color: inherit;
}

.iccsearch-product-card__image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.iccsearch-product-card__image img {
  width: 100%;
  max-height: 100%;
  object-fit: contain;
  padding: 8px;
}

.iccsearch-product-card__body {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.iccsearch-product-card__name {
  font-family: Inter, sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  color: #000;
  line-height: 26px;
  min-height: 52px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.iccsearch-product-card__ref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 26px;
}
.iccsearch-product-card__ref {
  font-family: Inter, sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  color: #858585;
  line-height: 26px;
}
.iccsearch-product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
}
.iccsearch-product-card__stock {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: Inter, sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  flex-shrink: 0;
}
.iccsearch-product-card__stock svg {
  flex-shrink: 0;
}
.iccsearch-product-card__price {
  font-family: Inter, sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  color: #000;
  line-height: 26px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── Bouton Ajouter au panier ──────────────────────────── */
.iccsearch-add-to-cart {
  display: block;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid #313B3E;
  background-color: #313B3E;
  color: #fff;
  font-family: Inter, sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.iccsearch-add-to-cart:hover {
  background-color: #B71234;
  border-color: #B71234;
}
.iccsearch-add-to-cart:disabled {
  opacity: 0.7;
  cursor: default;
}

/* ─── Backdrop sidebar panier (au-dessus du panneau de recherche) ── */
.modal-backdrop.modal-backdrop--cart {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9999998;
  background-color: #000;
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .iccsearch-panel__header {
    padding: 12px 16px;
    gap: 12px;
  }
  .iccsearch-panel__logo img {
    max-height: 30px;
  }
  .iccsearch-panel__input {
    height: 42px;
    font-size: 14px;
  }
  .iccsearch-results {
    padding: 12px 16px 20px;
  }
  .iccsearch-results__label {
    font-size: 18px;
    line-height: 20px;
    padding-left: 0;
  }
  .iccsearch-slider-wrap {
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .iccsearch-panel__logo {
    display: none;
  }
}
