/* ========== ZIC ETHIC PRO - DEVIS ========== */
.zepd-page { box-sizing: border-box; }
.zepd-page *, .zepd-page *::before, .zepd-page *::after { box-sizing: border-box; }

.zepd-page {
  --zepd-accent: #3858E9;
  --zepd-accent-dark: #2d47c9;
  --zepd-dark: #333333;
  --zepd-gray-900: #333333;
  --zepd-gray-700: #5a6068;
  --zepd-gray-500: #8a8f96;
  --zepd-gray-300: #BABFC5;
  --zepd-gray-200: #DCDCDE;
  --zepd-gray-100: #f0f1f3;
  --zepd-gray-50: #fafafa;
  --zepd-white: #fff;
  --zepd-radius: 10px;
  --zepd-radius-sm: 6px;
  --zepd-shadow: 0 2px 10px rgba(51,51,51,0.06);
  --zepd-shadow-lg: 0 8px 30px rgba(51,51,51,0.12);

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--zepd-gray-900);
  line-height: 1.5;
  font-size: 15px;

  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 0;
}
@media (max-width: 1023px) {
  .zepd-page { grid-template-columns: 1fr; padding-bottom: 100px; }
}

/* HEADER */
.zepd-header {
  grid-column: 1 / -1;
  background: var(--zepd-white);
  border-radius: var(--zepd-radius);
  padding: 24px 28px;
  box-shadow: var(--zepd-shadow);
}
.zepd-header h1 { font-size: 26px; font-weight: 700; margin: 0 0 4px; color: var(--zepd-gray-900); }
.zepd-header h1 em { font-style: normal; color: var(--zepd-accent); }
.zepd-header p { color: var(--zepd-gray-500); font-size: 14px; margin: 0; }

/* FILTERS */
.zepd-filters {
  background: var(--zepd-white);
  border-radius: var(--zepd-radius);
  padding: 18px 20px;
  box-shadow: var(--zepd-shadow);
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.zepd-filter-group { display: flex; flex-direction: column; gap: 4px; }
.zepd-filter-group label {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--zepd-gray-500);
}
.zepd-filter-group select,
.zepd-filter-group input {
  border: 1px solid var(--zepd-gray-300);
  border-radius: var(--zepd-radius-sm);
  padding: 8px 12px; font-size: 14px;
  background: var(--zepd-white);
  min-width: 140px;
  font-family: inherit;
  color: var(--zepd-gray-900);
}
.zepd-filter-group select:focus,
.zepd-filter-group input:focus {
  outline: none;
  border-color: var(--zepd-accent);
  box-shadow: 0 0 0 3px rgba(56,88,233,0.15);
}
.zepd-search-group { flex: 1; min-width: 220px; }
.zepd-search-group input { width: 100%; min-width: 0; }

.zepd-label-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.zepd-label-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--zepd-gray-300);
  background: var(--zepd-white);
  color: var(--zepd-gray-700);
  transition: all 0.15s;
  user-select: none;
}
.zepd-label-pill:hover {
  border-color: var(--zepd-gray-500);
}
/* Point de couleur (vient du JS via style="background:...") */
.zepd-label-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--zepd-accent); /* fallback si pas de style inline */
}
/* État actif (fond plein, texte blanc) — le JS surcharge background/border avec la couleur du label */
.zepd-label-pill.active {
  color: var(--zepd-white);
  border-color: transparent;
  background: var(--zepd-accent);
}
/* Quand actif, le point devient blanc (puisque le fond a pris la couleur) */
.zepd-label-pill.active .dot {
  background: var(--zepd-white) !important;
}

/* Chips sous-catégories (apparait quand une famille est sélectionnée) */
.zepd-subcat-chips {
  background: var(--zepd-white);
  border-radius: var(--zepd-radius);
  padding: 12px 18px;
  margin-bottom: 16px;
  box-shadow: var(--zepd-shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.zepd-subcat-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--zepd-gray-500);
  margin-right: 6px;
}
.zepd-subcat-chip {
  display: inline-flex; align-items: center;
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--zepd-gray-200);
  background: var(--zepd-gray-50);
  color: var(--zepd-gray-700);
  transition: all 0.15s;
  user-select: none;
  white-space: nowrap;
}
.zepd-subcat-chip:hover {
  background: var(--zepd-gray-100);
  border-color: var(--zepd-gray-300);
}
.zepd-subcat-chip.active {
  background: var(--zepd-accent);
  border-color: var(--zepd-accent);
  color: var(--zepd-white);
}
.zepd-subcat-chip .count {
  margin-left: 4px;
  font-size: 11px;
  opacity: 0.7;
  font-weight: 400;
}
.zepd-subcat-chip.active .count { opacity: 0.9; }

.zepd-results-info {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 4px;
  margin-bottom: 12px;
  font-size: 13px; color: var(--zepd-gray-500);
}
.zepd-reset-btn {
  background: none; border: none;
  color: var(--zepd-accent);
  font-weight: 600; cursor: pointer; font-size: 13px;
  font-family: inherit; padding: 0;
}
.zepd-reset-btn:hover { text-decoration: underline; }

/* PRODUCT LIST */
.zepd-product-list { display: flex; flex-direction: column; gap: 8px; }
.zepd-product-row {
  background: var(--zepd-white);
  border-radius: var(--zepd-radius);
  padding: 16px;
  display: grid;
  grid-template-columns: 80px 1fr auto auto;
  gap: 18px;
  align-items: center;
  box-shadow: var(--zepd-shadow);
  transition: box-shadow 0.15s;
}
.zepd-product-row:hover { box-shadow: var(--zepd-shadow-lg); }

.zepd-product-img {
  width: 80px; height: 80px;
  background: var(--zepd-gray-100);
  border-radius: var(--zepd-radius-sm);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.zepd-product-img img { width: 100%; height: 100%; object-fit: contain; }

.zepd-product-info { min-width: 0; }
.zepd-product-name { font-size: 16px; font-weight: 700; color: var(--zepd-gray-900); margin: 0 0 2px; }
.zepd-product-desc {
  font-size: 13px; color: var(--zepd-gray-500); margin-bottom: 8px; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.zepd-product-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.zepd-badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 12px;
  font-size: 11px; font-weight: 600; line-height: 1.4;
  white-space: nowrap;
}
.zepd-badge-gamme { background: var(--zepd-gray-100); color: var(--zepd-gray-700); border: 1px solid var(--zepd-gray-200); }
.zepd-badge-label { background: var(--zepd-accent); color: var(--zepd-white); }

.zepd-qty-control {
  display: flex; align-items: center;
  border: 1px solid var(--zepd-gray-300);
  border-radius: var(--zepd-radius-sm);
  overflow: hidden;
}
.zepd-qty-control button {
  background: var(--zepd-gray-100); border: none;
  width: 32px; height: 32px; font-size: 16px;
  cursor: pointer; color: var(--zepd-gray-700);
  font-family: inherit;
}
.zepd-qty-control button:hover { background: var(--zepd-gray-200); }
.zepd-qty-control input {
  width: 44px; height: 32px; border: none; text-align: center;
  font-size: 14px; font-weight: 600; font-family: inherit;
  color: var(--zepd-gray-900); background: var(--zepd-white);
  -moz-appearance: textfield;
}
.zepd-qty-control input::-webkit-inner-spin-button,
.zepd-qty-control input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.zepd-qty-control input:focus { outline: none; }

.zepd-add-btn {
  background: var(--zepd-dark); color: var(--zepd-white); border: none;
  padding: 8px 18px; height: 34px;
  border-radius: var(--zepd-radius-sm);
  font-weight: 600; font-size: 13px;
  cursor: pointer; font-family: inherit;
  transition: background 0.15s; white-space: nowrap;
}
.zepd-add-btn:hover { background: var(--zepd-accent); }
.zepd-add-btn.added { background: #00a86b; pointer-events: none; }

@media (max-width: 700px) {
  .zepd-product-row {
    grid-template-columns: 64px 1fr;
    grid-template-areas: "img info" "qty btn";
    gap: 12px;
  }
  .zepd-product-img { grid-area: img; width: 64px; height: 64px; }
  .zepd-product-info { grid-area: info; }
  .zepd-qty-control { grid-area: qty; }
  .zepd-add-btn { grid-area: btn; }
}

/* SIDEBAR */
.zepd-devis-sidebar {
  background: var(--zepd-white);
  border-radius: var(--zepd-radius);
  box-shadow: var(--zepd-shadow);
  padding: 20px;
  position: sticky; top: 24px;
  height: fit-content;
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
}
.zepd-devis-sidebar h2 {
  font-size: 17px; font-weight: 700; margin: 0 0 4px;
  display: flex; align-items: center; justify-content: space-between;
}
.zepd-devis-count {
  background: var(--zepd-accent); color: var(--zepd-white);
  font-size: 12px; font-weight: 600;
  min-width: 24px; height: 24px; border-radius: 12px;
  padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
}
.zepd-devis-empty { text-align: center; padding: 32px 12px; color: var(--zepd-gray-500); font-size: 13px; }
.zepd-devis-empty-icon { font-size: 40px; margin-bottom: 8px; opacity: 0.3; }
.zepd-devis-items { list-style: none; margin: 12px 0; padding: 0; overflow-y: auto; flex: 1; max-height: 50vh; }
.zepd-devis-item {
  display: grid; grid-template-columns: 36px 1fr auto;
  gap: 10px; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--zepd-gray-100);
}
.zepd-devis-item:last-child { border-bottom: none; }
.zepd-devis-item-img {
  width: 36px; height: 36px;
  background: var(--zepd-gray-100); border-radius: 4px;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.zepd-devis-item-img img { width: 100%; height: 100%; object-fit: contain; }
.zepd-devis-item-info { min-width: 0; }
.zepd-devis-item-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zepd-devis-item-qty { font-size: 12px; color: var(--zepd-gray-500); }
.zepd-devis-item-remove {
  background: none; border: none; color: var(--zepd-gray-500);
  cursor: pointer; font-size: 16px; padding: 4px; line-height: 1;
}
.zepd-devis-item-remove:hover { color: #ff4d4d; }

.zepd-devis-cta {
  background: var(--zepd-dark); color: var(--zepd-white); border: none;
  padding: 14px; border-radius: var(--zepd-radius-sm);
  font-weight: 600; font-size: 14px; cursor: pointer;
  font-family: inherit; width: 100%; margin-top: 12px;
  transition: background 0.15s;
}
.zepd-devis-cta:hover:not(:disabled) { background: var(--zepd-accent); }
.zepd-devis-cta:disabled { background: var(--zepd-gray-300); cursor: not-allowed; }
.zepd-devis-note { margin-top: 10px; font-size: 11px; color: var(--zepd-gray-500); text-align: center; line-height: 1.4; }

@media (max-width: 1023px) {
  .zepd-devis-sidebar {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto;
    border-radius: var(--zepd-radius) var(--zepd-radius) 0 0;
    max-height: 70vh;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 10; padding: 14px 16px;
  }
  .zepd-devis-sidebar.collapsed .zepd-devis-items,
  .zepd-devis-sidebar.collapsed .zepd-devis-note { display: none; }
  .zepd-devis-sidebar.collapsed { padding: 12px 16px; }
  .zepd-devis-toggle { display: inline-block !important; background: none; border: none; cursor: pointer; color: var(--zepd-gray-500); font-size: 13px; font-family: inherit; margin-left: 8px; }
}
.zepd-devis-toggle { display: none; }

/* MODAL */
.zepd-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: none; align-items: center; justify-content: center;
  z-index: 100000;
  padding: 20px; overflow-y: auto;
}
.zepd-modal-overlay.show { display: flex; }

/* ========== MODAL FORMULAIRE - Design system Zic Ethic Pro ========== */
/* Palette : #3858E9 (accent) · #333333 (texte) · #BABFC5 (bordures) · #DCDCDE (séparateurs/bords doux) */

.zepd-modal {
  background: #fafafa !important;
  border-radius: var(--zepd-radius); 
  padding: 32px;
  max-width: 580px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(51, 51, 51, 0.25);
  font-family: inherit;
  color: #333333 !important;
  position: relative;
}

/* Bouton croix fermeture */
.zepd-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 50%;
  color: #5a6068;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  z-index: 1;
}
.zepd-modal-close:hover {
  background: #ffffff;
  border-color: #BABFC5;
  color: #333333;
}
.zepd-modal-close:active {
  background: #DCDCDE;
}
.zepd-modal-close:focus {
  outline: none;
  border-color: #3858E9;
  box-shadow: 0 0 0 3px rgba(56, 88, 233, 0.15);
}
/* Sur petit écran, la croix garde sa position absolue mais on ajuste un peu le padding du modal pour pas que le titre passe dessous */
@media (max-width: 480px) {
  .zepd-modal { padding: 24px 20px; }
  .zepd-modal-close { top: 12px; right: 12px; }
}
.zepd-modal h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 6px;
  color: #333333 !important;
  letter-spacing: -0.2px;
  padding-right: 40px;
}
.zepd-modal-subtitle {
  color: #5a6068 !important;
  font-size: 14px;
  margin-bottom: 28px;
  line-height: 1.5;
}

.zepd-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.zepd-form-group { display: flex; flex-direction: column; gap: 6px; }
.zepd-form-group.full { grid-column: 1 / -1; }

/* Labels des champs : bien lisibles */
.zepd-form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #333333 !important;
  letter-spacing: 0.1px;
}
.zepd-form-group label .req {
  color: #3858E9 !important;
  font-weight: 700;
  margin-left: 2px;
}

/* Inputs : fond blanc, bordures #BABFC5 bien visibles, focus accent */
.zepd-form-group input,
.zepd-form-group select,
.zepd-form-group textarea {
  border: 1.5px solid #BABFC5 !important;
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  color: #333333 !important;
  background: #ffffff !important;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.4;
}
.zepd-form-group input::placeholder,
.zepd-form-group textarea::placeholder {
  color: #BABFC5;
  opacity: 1;
}
.zepd-form-group input:hover,
.zepd-form-group select:hover,
.zepd-form-group textarea:hover {
  border-color: #8a8f96 !important;
}
.zepd-form-group input:focus,
.zepd-form-group select:focus,
.zepd-form-group textarea:focus {
  outline: none;
  border-color: #3858E9 !important;
  box-shadow: 0 0 0 3px rgba(56, 88, 233, 0.15);
}
.zepd-form-group select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23333333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 12px 8px !important;
  padding-right: 38px !important;
}

/* Titres de section (INTERLOCUTEUR, ADRESSE…) : bien plus visibles */
.zepd-form-section-title {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #333333 !important;
  margin-top: 18px;
  padding-top: 18px;
  padding-bottom: 4px;
  border-top: 1px solid #DCDCDE;
  position: relative;
}
.zepd-form-section-title:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}
/* Petit accent visuel à gauche du titre de section */
.zepd-form-section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18px;
  width: 3px;
  height: 14px;
  background: #3858E9;
  border-radius: 2px;
  display: none; /* désactivé pour rester sobre, dé-commenter pour l'effet barre */
}

/* Checkbox "adresse identique" : bien intégrée */
.zepd-checkbox-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #333333 !important;
  cursor: pointer;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #DCDCDE;
  border-radius: 8px;
  margin-top: 4px;
  transition: border-color 0.15s, background 0.15s;
}
.zepd-checkbox-row:hover {
  border-color: #BABFC5;
}
.zepd-checkbox-row input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #3858E9;
  margin: 0;
}

/* Zone d'erreur dans le formulaire */
.zepd-form-error {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  margin-top: 20px;
  background: #FEE7E7 !important;
  border: 1.5px solid #E53935;
  border-radius: 8px;
  color: #C62828 !important;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  animation: zepd-error-shake 0.4s ease;
}
.zepd-form-error-icon {
  flex-shrink: 0;
  color: #E53935;
  margin-top: 1px;
}
.zepd-form-error-text {
  color: #C62828 !important;
}
@keyframes zepd-error-shake {
  0%   { transform: translateX(0); opacity: 0; }
  10%  { opacity: 1; }
  20%  { transform: translateX(-4px); }
  40%  { transform: translateX(4px); }
  60%  { transform: translateX(-3px); }
  80%  { transform: translateX(2px); }
  100% { transform: translateX(0); opacity: 1; }
}

/* Actions modal : boutons bien hiérarchisés */
.zepd-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #DCDCDE;
  grid-column: 1 / -1;
}

/* Bouton primaire : action principale, accent bleu */
.zepd-btn-primary {
  background: #3858E9 !important;
  color: #ffffff !important;
  border: 1.5px solid #3858E9 !important;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  letter-spacing: 0.2px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s;
  box-shadow: 0 1px 2px rgba(56, 88, 233, 0.2);
}
.zepd-btn-primary:hover {
  background: #2d47c9 !important;
  border-color: #2d47c9 !important;
  box-shadow: 0 4px 12px rgba(56, 88, 233, 0.3);
}
.zepd-btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(56, 88, 233, 0.2);
}
.zepd-btn-primary:disabled {
  background: #BABFC5 !important;
  border-color: #BABFC5 !important;
  cursor: not-allowed;
  box-shadow: none;
}

/* Bouton secondaire : action de retrait, plus discret mais visible */
.zepd-btn-secondary {
  background: #ffffff !important;
  border: 1.5px solid #BABFC5 !important;
  color: #333333 !important;
  padding: 12px 22px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  letter-spacing: 0.2px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.zepd-btn-secondary:hover {
  border-color: #333333 !important;
  background: #f4f5f7 !important;
}
.zepd-btn-secondary:active {
  background: #DCDCDE !important;
}

/* Honeypot caché */
.zepd-honeypot { position: absolute !important; left: -9999px !important; opacity: 0 !important; }

/* CONFIRMATION */
.zepd-confirmation { text-align: center; padding: 20px 0; }
.zepd-confirmation-icon {
  width: 64px; height: 64px;
  background: #00a86b; border-radius: 50%;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 32px;
}
.zepd-confirmation h2 { margin: 0 0 8px; }
.zepd-confirmation-number {
  display: inline-block;
  background: var(--zepd-gray-100); border: 1.5px dashed var(--zepd-gray-300);
  border-radius: var(--zepd-radius-sm);
  padding: 10px 20px; font-weight: 700;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  margin: 16px 0; letter-spacing: 1px;
}
.zepd-confirmation p { color: var(--zepd-gray-500); margin: 0 0 8px; }

/* TOAST */
.zepd-toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--zepd-gray-900); color: white;
  padding: 12px 20px; border-radius: var(--zepd-radius-sm);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--zepd-shadow-lg);
  z-index: 100001; transition: transform 0.3s;
}
.zepd-toast.show { transform: translateX(-50%) translateY(0); }
@media (max-width: 1023px) { .zepd-toast { bottom: 100px; } }
