/* assets/css/ap-style.css */
/* Conteneur général */
/* Conteneur général */
.ap-annuaire {
  max-width: 980px;
  margin: 20px auto;
  padding: 0 12px;
  box-sizing: border-box;
}

/* Formulaire */
.ap-form {
  display: flex;
  flex-wrap: wrap;      /* permet de passer à la ligne si espace trop petit */
  gap: 8px;
  margin-bottom: 1em;
}

/* Inputs et selects */
.ap-form input,
.ap-form select {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  flex: 1 1 200px;     /* largeur flexible avec min 200px */
  min-width: 150px;    /* ne devient pas trop petit */
  box-sizing: border-box;
}

/* Bouton */
button.ap-btn {
  background: #4159c5;!important;
  /*border: 1px solid #c36!important;*/
  border-radius: 3px!important;
  color: #ffff!important;
  font-size: 1rem!important;
  font-weight: 400!important;
  padding: 0.5rem 1rem!important;
  text-align: center!important;
  cursor: pointer!important;
  flex: 0 0 auto!important;       /* ne s’étire pas comme les selects */
  transition: all 0.3s ease!important;
  width: 50%;
  margin: 0 auto;
  top:10px;
}

/* Hover bouton */
.ap-btn:hover {
  background-color:#0463af !important
  color: #fff!important;
}

/* MOBILE : empilement complet */
@media (max-width: 768px) {
  .ap-form {
    flex-direction: column;
    gap: 12px;
  }

  .ap-form input,
  .ap-form select,
  .ap-btn {
    width: 100%;       /* remplissent toute la largeur */
    min-width: unset;  /* supprime la contrainte min-width */
  }
}

/* Selects natifs */
/* Selects natifs */
.ap-form select {
    height: auto !important;      /* hauteur auto */
    min-height: 38px !important;  /* hauteur minimum */
    max-height: 42px !important;  /* hauteur max pour uniformité */
    line-height: normal !important;
    padding: 6px 8px !important;
    font-size: 1rem !important;
    box-sizing: border-box !important;
    appearance: none;             /* supprime style natif flèche sur certains navigateurs */
    background-color: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
}


/* Pour que Select2 ne dépasse pas */
.select2-container--default .select2-selection--single {
  height: 38px;       /* même hauteur que le select natif */
  line-height: 38px;  /* texte centré verticalement */
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 38px;  /* texte centré */
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 38px;       /* arrow alignée */
}


.ap-results-section {
  margin-bottom: 18px !important;
}
.ap-item {
  border: 1px solid #eee !important;
  padding: 10px !important;
  margin-bottom: 8px !important;
  border-radius: 6px !important;
  background: #fff !important;
}
.ap-meta {
  color: #666 !important;
  font-size: 13px !important;
  margin-bottom: 6px !important;
}
.ap-avis {
  color: #222 !important;
  font-style: italic !important;
}

.ap-badge {
  padding: 2px 6px !important;
  border-radius: 4px !important;
  color: #fff !important;
  font-weight: bold !important;
}
.ap-active {
  background-color: green !important;
}
.ap-past_due {
  background-color: orange !important;
}
.ap-canceled {
  background-color: red !important;
}
#ap-results-wrapper {
  max-height: 500px; /* ou auto si tu veux que ça pousse la page */
  overflow-y: auto;   /* scroll seulement pour les résultats */
  margin-bottom: 15px;
}

/* Pagination reste en dehors du scroll */
#ap-pagination {
  text-align: center;
  margin-top: 10px;
}
#ap-results {
  max-height: 70vh; /* ajuste selon ton layout */
  overflow-y: auto;
  scroll-behavior: smooth; /* scroll fluide */
  padding-right: 8px; /* évite que le scrollbar mange le contenu */
}

/* Pagination container */
#ap-pagination {
  margin-top: 15px;
  text-align: center;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
}

/* Boutons de pagination */
#ap-pagination .ap-page-btn {
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 4px;
  min-width: 36px;
  transition: all 0.2s;
  font-weight: 500;
}

/* Hover */
#ap-pagination .ap-page-btn:hover:not([disabled]) {
  background-color: #c36;
  color: #fff;
  border-color: #c36;
}

/* Active page */
#ap-pagination .ap-page-btn.active {
  background-color: #c36;
  color: #fff;
  border-color: #c36;
  font-weight: bold;
}

/* Disabled */
#ap-pagination .ap-page-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
    font-size: 16px;          /* augmente la taille du × */
    width: 24px;               /* zone cliquable plus large */
    height: 24px;
    line-height: 24px;
    right: 8px;                /* décale le × un peu */
    cursor: pointer;
    color: #c36;               /* couleur visible */
}

.select2-container--default .select2-selection--single:hover .select2-selection__clear {
    color: #fff;
    background-color: #c36;
    border-radius: 50%;
}

.product-entry-wrapper {
    display: none !important;
}

.related.products {
    display: none !important;
}

/* ============================================
   AP SEARCH FORM — Professional Styling
   ============================================ */

/* Google Font Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* Form Container */
#ap-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  background: #ffffff;
  padding: 28px 32px;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  font-family: 'Inter', sans-serif;
  max-width: 1100px;
  margin: 0 auto;
  border: 1px solid #f0f0f5;
  margin-bottom:27px;
}

/* Field Wrapper — chaque select prend de la place */
#ap-search-form select {
  flex: 1 1 200px;
  min-width: 180px;
  height: 48px;
  padding: 0 40px 0 14px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #2d2d3a;
  background-color: #f8f8fc;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  border: 1.5px solid #e2e2ef;
  border-radius: 10px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

#ap-search-form select:hover {
  border-color: #a5b4fc;
  background-color: #ffffff;
}

#ap-search-form select:focus {
  border-color: #6366f1;
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* Placeholder option style */
#ap-search-form select option[value=""] {
  color: #9ca3af;
}

/* ============================================
   SELECT2 OVERRIDE (reg_company_select)
   ============================================ */

/* Select2 container */
.ap-select2 + .select2-container {
  flex: 1 1 220px;
  min-width: 200px;
}

.select2-container--default .select2-selection--single {
  height: 48px !important;
  padding: 0 40px 0 14px !important;
  background-color: #f8f8fc !important;
  border: 1.5px solid #e2e2ef !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: #6366f1 !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12) !important;
  outline: none !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  font-family: 'Inter', sans-serif !important;
  font-size: 14px !important;
  color: #2d2d3a !important;
  line-height: 48px !important;
  padding: 0 !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: #9ca3af !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 48px !important;
  right: 12px !important;
}

/* Dropdown */
.select2-dropdown {
  border: 1.5px solid #e2e2ef !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 14px !important;
  overflow: hidden;
  margin-top: 4px;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1.5px solid #e2e2ef !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 14px !important;
  outline: none !important;
  transition: border-color 0.2s ease;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

.select2-results__option {
  padding: 10px 14px !important;
  color: #2d2d3a !important;
  transition: background 0.15s ease !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: #6366f1 !important;
  color: #ffffff !important;
}

.select2-container--default .select2-results__option[aria-selected="true"] {
  background-color: #ede9fe !important;
  color: #4f46e5 !important;
  font-weight: 500 !important;
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */

/*.ap-btn {
  flex: 0 0 auto;
  height: 48px;
  padding: 0 28px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.ap-btn:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}

.ap-btn:active {
  transform: translateY(0px);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.ap-btn:focus-visible {
  outline: 3px solid rgba(99, 102, 241, 0.5);
  outline-offset: 2px;
}*/

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  #ap-search-form {
    padding: 20px 18px;
    gap: 10px;
    border-radius: 12px;
  }

  #ap-search-form select,
  .ap-select2 + .select2-container {
    flex: 1 1 100%;
    min-width: 100%;
  }

  .ap-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  #ap-search-form {
    padding: 16px 14px;
  }

  #ap-search-form select,
  .ap-btn {
    height: 44px;
    font-size: 13px;
  }
}


