.product-catalogue-card {
  overflow: visible;
  border: 0;
  border-radius: 18px;
}

.product-catalogue-card > .card-body {
  padding: clamp(1rem, 2vw, 1.75rem);
}

.product-catalogue-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.product-catalogue-toolbar .card-title {
  padding: 0;
  margin: 0 0 .25rem;
  /* Seul titre de la page (le bandeau du haut est retire pour eviter le doublon). */
  font-size: 1.15rem;
  font-weight: 700;
}

.product-catalogue-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .5rem;
}

.product-catalogue-actions .btn {
  border-radius: 10px;
  white-space: nowrap;
}

/* Barre de recherche : presque toute la largeur du conteneur, legerement en retrait. */
.product-search-stage {
  width: calc(100% - 3rem);
  margin: 1.25rem auto 0;
  text-align: center;
}

.product-search-shell {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 5px 5px 5px 3.25rem;
  border: 1px solid var(--bs-border-color, #d9e2ef);
  border-radius: 999px;
  background: var(--bs-body-bg, #fff);
  box-shadow: 0 12px 32px rgba(15, 23, 42, .09);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.product-search-shell:focus-within {
  border-color: var(--bs-primary, #4154f1);
  box-shadow: 0 0 0 4px rgba(65, 84, 241, .12), 0 14px 34px rgba(15, 23, 42, .12);
}

.product-search-icon {
  position: absolute;
  left: 1.2rem;
  color: var(--bs-secondary-color, #6c757d);
  font-size: 1.2rem;
  pointer-events: none;
}

.product-search-input {
  min-width: 0;
  height: 46px;
  padding: 0 .75rem;
  border: 0;
  background: transparent;
  box-shadow: none !important;
  font-size: 1rem;
}

.product-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.product-search-loader {
  display: inline-flex;
  align-items: center;
  margin-right: .5rem;
  color: var(--bs-primary, #4154f1);
}

.product-search-shortcut {
  margin-right: .6rem;
  padding: .15rem .5rem;
  border: 1px solid var(--bs-border-color, #d9e2ef);
  border-radius: 6px;
  color: var(--bs-secondary-color, #6c757d);
  background: var(--bs-tertiary-bg, #f3f5f9);
  box-shadow: none;
  font-size: .75rem;
  line-height: 1.4;
}

/* Le raccourci disparait des que l'on tape ou que le champ a le focus. */
.product-search-shell:focus-within .product-search-shortcut,
.product-search-input:not(:placeholder-shown) ~ .product-search-shortcut {
  display: none;
}

.product-search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: var(--bs-secondary-color, #6c757d);
  background: transparent;
}

.product-search-clear:hover,
.product-search-clear:focus-visible {
  color: var(--bs-body-color, #1f2937);
  background: var(--bs-tertiary-bg, #eef1f5);
}

.product-search-clear[hidden] {
  display: none;
}

.product-search-submit {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: .45rem;
  min-height: 46px;
  padding-inline: 1.4rem;
  border-radius: 999px !important;
  font-weight: 600;
  white-space: nowrap;
}

.product-search-help {
  margin: .65rem 0 0;
  color: var(--bs-secondary-color, #6c757d);
  font-size: .78rem;
}

.product-filter-panel {
  padding: 1rem;
  border: 1px solid var(--bs-border-color, #dfe6ef);
  border-radius: 15px;
  background: color-mix(in srgb, var(--bs-tertiary-bg, #f6f8fb) 72%, transparent);
}

.product-filter-panel-header,
.product-filter-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.product-filter-panel-header {
  margin-bottom: .85rem;
}

.product-filter-count {
  min-width: 1.65rem;
  padding: .25rem .5rem;
  border-radius: 999px;
  color: var(--bs-primary, #4154f1);
  background: var(--bs-primary-bg-subtle, #e9edff);
  text-align: center;
  font-size: .75rem;
  font-weight: 700;
}

.product-filter-panel .form-label {
  margin-bottom: .35rem;
  color: var(--bs-secondary-color, #5c677a);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .015em;
}

.product-filter-panel .form-select,
.product-filter-panel .faccontrol-search-pdv-control {
  min-height: 44px;
  border-radius: 10px;
  background-color: var(--bs-body-bg, #fff);
}

.product-filter-panel-footer {
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px solid var(--bs-border-color, #dfe6ef);
}

.product-result-count {
  font-variant-numeric: tabular-nums;
}

.product-table-wrap {
  margin-top: .75rem;
  border: 1px solid var(--bs-border-color, #e2e8f0);
  border-radius: 14px;
  overflow-x: auto;
}

.product-table-wrap .table {
  margin-bottom: 0;
}

.product-table-wrap .table tbody {
  transition: opacity .12s ease;
}

.product-table-wrap.is-loading .table tbody {
  opacity: .55;
}

.product-table-wrap mark {
  padding: 0 .1em;
  border-radius: 3px;
  color: inherit;
  background: color-mix(in srgb, var(--bs-warning, #ffc107) 38%, transparent);
}

/* Une ligne par produit a tout zoom : le tableau defile plutot que de
   replier ses cellules (groupe taxe sur 3 lignes, boutons empiles). */
.product-table-wrap thead th,
.product-table-wrap tbody td,
.product-table-wrap tbody th {
  white-space: nowrap;
}

.product-table-wrap tbody td:last-child .btn + .btn {
  margin-left: 4px;
}

.product-table-empty {
  padding: 3rem 1rem !important;
  color: var(--bs-secondary-color, #6c757d) !important;
  text-align: center;
  white-space: normal !important;
}

/* --- Disposition stable quel que soit le zoom ----------------------------
   En-tete sur une ligne (le sous-titre s'abrege), six filtres sur une ligne.
   Les boutons secondaires passent en icone seule quand la largeur baisse. */
.product-catalogue-card .fc-page-head {
  flex-wrap: nowrap;
}

.product-catalogue-card .fc-page-head-text {
  flex: 1 1 auto;
  min-width: 0;
}

.product-catalogue-card .fc-page-head-text p {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.product-catalogue-card .fc-page-head-actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

.product-filter-grid {
  display: grid;
  grid-template-columns: minmax(150px, 2.2fr) repeat(5, minmax(80px, 1fr));
  gap: 12px;
  align-items: end;
}

.product-filter-grid > * {
  min-width: 0;
}

.product-filter-grid .form-select {
  text-overflow: ellipsis;
}

/* Selecteur de magasins sur une seule ligne : les puces s'abregent. */
.product-point-filter-wrapper .faccontrol-search-pdv-control {
  flex-wrap: nowrap;
}

.product-point-filter-wrapper .faccontrol-search-chip {
  flex: 0 1 auto;
  min-width: 0;
}

.product-point-filter-wrapper .faccontrol-search-chip-label {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.product-point-filter-wrapper .faccontrol-search-input {
  flex: 1 1 56px;
  width: 56px;
  min-width: 56px;
}

@media (max-width: 1699.98px) {
  .product-action--compact {
    padding-inline: 13px !important;
  }

  .product-action--compact .product-action-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (max-width: 1099.98px) {
  .product-action--compact-narrow {
    padding-inline: 13px !important;
  }

  .product-action--compact-narrow .product-action-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* Telephone : la seule largeur ou l'on empile reellement. */
@media (max-width: 767.98px) {
  .product-catalogue-card .fc-page-head,
  .product-catalogue-card .fc-page-head-actions {
    flex-wrap: wrap;
  }

  .product-catalogue-card .fc-page-head-text p {
    white-space: normal;
  }

  .product-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-filter-grid > .product-point-filter-wrapper {
    grid-column: 1 / -1;
  }
}

@media (max-width: 575.98px) {
  .product-filter-panel-footer {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 575.98px) {
  .product-search-stage {
    width: 100%;
  }

  .product-search-shortcut {
    display: none;
  }

  .product-search-shell {
    min-height: 54px;
    padding-left: 2.7rem;
  }

  .product-search-icon {
    left: 1rem;
  }

  .product-search-submit span {
    display: none;
  }

  .product-search-submit {
    width: 44px;
    min-width: 44px;
    padding: 0;
  }
}
