/* ============================================================
   Conseil de Geek — Recherche avancée Amazon  v2.0
   ============================================================ */

/* ── 1. Ajustements barre de recherche Amazon ─────────────────────────────── */

#nav-search.cdg-search-open .nav-search-scope.nav-sprite {
  border-radius: 4px 0 0 0 !important;
}

#nav-search.cdg-search-open .nav-search-submit.nav-sprite {
  border-radius: 0 4px 0 0 !important;
}

.nav-searchbar.nav-active,
.nav-searchbar.nav-focus {
  box-shadow: none !important;
  border: 0 !important;
}

.nav-searchbar.nav-active .nav-search-scope,
.nav-searchbar.nav-focus .nav-search-scope,
.nav-searchbar.nav-active .nav-search-field,
.nav-searchbar.nav-focus .nav-search-field {
  border: 0 !important;
}

#nav-flyout-searchAjax {
  display: none !important;
}

#nav-fill-search {
  position: relative !important;
  overflow: visible !important;
}

#nav-search {
  overflow: visible !important;
}

#nav-search.cdg-search-open .nav-searchbar {
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

#navbar.nav-flex.layout3 #nav-belt #nav-search,
#navbar.nav-flex.layout3 #nav-belt #nav-search.nav-fixed,
#navbar.nav-flex.layout3.nav-fixed #nav-belt #nav-search,
#navbar.nav-flex.layout3.nav-fixed #nav-belt #nav-search.nav-fixed {
  padding: 10px 0 !important;
}

/* ── 2. Bouton déclencheur CDG ─────────────────────────────────────────────── */

#cdg-trigger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 10px;
  margin-left: 6px;
  background: #e47911;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-family: "Amazon Ember", Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  vertical-align: middle;
  transition: background 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}

#cdg-trigger-btn:hover {
  background: #c96a00;
}

/* ── 3. Conteneur du panneau ───────────────────────────────────────────────── */

#cdg-panel {
  display: none;
  position: absolute;
  top: 50px;
  z-index: 999999;
  background: #fff;
  border: 1px solid #d5d9d9;
  border-top: 1px solid #d1d1d1;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 24px rgba(15, 17, 17, 0.18);
  box-sizing: border-box;
  font-family: "Amazon Ember", Arial, sans-serif;
}

@media (max-width: 800px) {
  #cdg-panel { margin: 0; width: 100%; }
}

@media (min-width: 1100px) {
  #cdg-panel { margin: 0 6px; }
}

@media (min-width: 1300px) {
  #cdg-panel { margin: 0 10px; }
}

@media (min-width: 1700px) {
  #cdg-panel { margin: 0 18px; width: calc(100% - 36px) !important; }
}

/* ── 4. Panneau principal ─────────────────────────────────────────────────── */

#cdg-panel-inner {
  font-family: "Amazon Ember", Arial, sans-serif;
  padding: 14px 16px 16px;
  background: #fff;
  color: #0f1111;
  border-radius: 0 0 6px 6px;
  box-sizing: border-box;
}

.cdg-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e7e9ec;
}

.cdg-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f1111;
  letter-spacing: -0.01em;
}

/* ── 5. Ligne 1 : Prime · Livraison · Note · Avis ──────────────────────────── */

.cdg-top-row {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e7e9ec;
}

.cdg-control-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cdg-control-label {
  font-size: 11px;
  font-weight: 700;
  color: #565959;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── 6. Toggle switch ─────────────────────────────────────────────────────── */

.cdg-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  height: 32px;
}

.cdg-toggle input[type="checkbox"] {
  display: none;
}

.cdg-toggle-track {
  position: relative;
  width: 36px;
  height: 20px;
  background: #d1d5db;
  border-radius: 10px;
  transition: background 0.2s;
  flex: 0 0 36px;
}

.cdg-toggle input:checked + .cdg-toggle-track {
  background: #e47911;
}

.cdg-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: left 0.2s;
}

.cdg-toggle input:checked + .cdg-toggle-track .cdg-toggle-thumb {
  left: 18px;
}

.cdg-prime-icon {
  background-image: url("https://m.media-amazon.com/images/S/sash/zv7$FyUZD0WQSVk.png");
  background-position: -181px -117px;
  background-repeat: no-repeat;
  background-size: 512px 256px;
  width: 53px;
  height: 15px;
  display: inline-block;
  flex: 0 0 53px;
}

/* ── 7. Case à cocher (FBA et similaires) ─────────────────────────────────── */

.cdg-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  cursor: pointer;
  font-family: "Amazon Ember", Arial, sans-serif;
  font-size: 13px;
  color: #0f1111;
  user-select: none;
}

.cdg-checkbox-label input[type="checkbox"] {
  display: none;
}

.cdg-checkbox-box {
  width: 16px;
  height: 16px;
  border: 2px solid #bbbfbf;
  border-radius: 3px;
  background: #fff;
  flex: 0 0 16px;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}

.cdg-checkbox-label input:checked + .cdg-checkbox-box {
  background: #e47911;
  border-color: #e47911;
}

.cdg-checkbox-label input:checked + .cdg-checkbox-box::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 4px;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

/* ── 8. Select stylé ──────────────────────────────────────────────────────── */

.cdg-select {
  height: 32px;
  min-width: 140px;
  border: 1px solid #bbbfbf;
  border-radius: 6px;
  padding: 0 28px 0 10px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23565959'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
  -webkit-appearance: none;
  font-family: "Amazon Ember", Arial, sans-serif;
  font-size: 13px;
  color: #0f1111;
  cursor: pointer;
  box-sizing: border-box;
}

.cdg-select:focus {
  outline: none;
  border-color: #007185;
  box-shadow: 0 0 0 2px #c8f3fa;
}

/* ── 8. Ligne 2 : Tag inputs ──────────────────────────────────────────────── */

.cdg-mid-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

@media (max-width: 700px) {
  .cdg-mid-row { grid-template-columns: 1fr; }
}

.cdg-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cdg-field-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #565959;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cdg-field-hint {
  font-size: 10px;
  font-weight: 400;
  color: #a0a0a0;
  text-transform: none;
  letter-spacing: 0;
}

.cdg-tag-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid #bbbfbf;
  border-radius: 6px;
  background: #fff;
  cursor: text;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.cdg-tag-wrap:focus-within {
  border-color: #007185;
  box-shadow: 0 0 0 2px #c8f3fa;
}

.cdg-tags {
  display: contents;
}

.cdg-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f0f2f2;
  border: 1px solid #d5d9d9;
  border-radius: 4px;
  padding: 2px 6px 2px 8px;
  font-size: 12px;
  color: #0f1111;
  white-space: nowrap;
  max-width: 180px;
}

.cdg-tag-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.cdg-tag-remove {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: #565959;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  flex: 0 0 14px;
}

.cdg-tag-remove:hover {
  background: #d5d9d9;
  color: #0f1111;
}

.cdg-tag-input {
  border: none;
  outline: none;
  background: transparent;
  font-family: "Amazon Ember", Arial, sans-serif;
  font-size: 13px;
  color: #0f1111;
  min-width: 120px;
  flex: 1;
  height: 24px;
  padding: 0;
}

.cdg-tag-input::placeholder {
  color: #a0a0a0;
}

/* ── 9. Ligne 3 : Prix + Tri + Actions ─────────────────────────────────────── */

.cdg-bot-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.cdg-price-group {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.cdg-price-sep {
  color: #a0a0a0;
  font-size: 16px;
  padding-bottom: 6px;
}

.cdg-price-field {
  min-width: 0;
}

.cdg-price-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.cdg-price-wrap input {
  width: 90px;
  height: 32px;
  border: 1px solid #bbbfbf;
  border-radius: 6px;
  padding: 0 28px 0 10px;
  font-family: "Amazon Ember", Arial, sans-serif;
  font-size: 13px;
  color: #0f1111;
  box-sizing: border-box;
  background: #fff;
}

.cdg-price-wrap input:focus {
  outline: none;
  border-color: #007185;
  box-shadow: 0 0 0 2px #c8f3fa;
}

.cdg-price-unit {
  position: absolute;
  right: 9px;
  font-size: 12px;
  color: #565959;
  pointer-events: none;
}

/* Masque les flèches des inputs number */
.cdg-price-wrap input::-webkit-outer-spin-button,
.cdg-price-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
}

.cdg-price-wrap input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Champ tri */
.cdg-sort-field {
  flex: 0 0 auto;
}

.cdg-sort-field .cdg-select {
  min-width: 185px;
}

/* ── 10. Boutons d'actions ─────────────────────────────────────────────────── */

.cdg-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

#cdg-close-button,
#cdg-search-button {
  border: none;
  border-radius: 100px;
  padding: 7px 18px;
  font-family: "Amazon Ember", Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

#cdg-close-button {
  background: #e7e9ec;
  color: #0f1111;
}

#cdg-close-button:hover {
  background: #d5d9d9;
}

#cdg-search-button {
  background: #e47911;
  color: #fff;
}

#cdg-search-button:hover {
  background: #c96a00;
}

/* ── 11. Footer transparence ───────────────────────────────────────────────── */

.cdg-footer-note {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e7e9ec;
  font-size: 10px;
  color: #a0a0a0;
  text-align: right;
}

/* ── 12. Badge Score Geek (page produit) ───────────────────────────────────── */

#cdg-score-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px 0;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #d5d9d9;
  border-left: 4px solid #e47911;
  border-radius: 6px;
  font-family: "Amazon Ember", Arial, sans-serif;
  font-size: 13px;
  color: #0f1111;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  box-sizing: border-box;
}

/* Spinner de chargement */
.cdg-score-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #e47911;
  border-top-color: transparent;
  border-radius: 50%;
  animation: cdg-spin 0.7s linear infinite;
  flex: 0 0 14px;
}

@keyframes cdg-spin {
  to { transform: rotate(360deg); }
}

/* État : score disponible */
.cdg-score-available .cdg-score-value {
  font-weight: 700;
  font-size: 14px;
}

.cdg-score-available .cdg-score-label {
  color: #565959;
  font-size: 13px;
}

.cdg-score-link {
  display: inline-block;
  margin-left: 8px;
  color: #007185;
  font-size: 12px;
  text-decoration: none;
  border-bottom: 1px dashed #007185;
}

.cdg-score-link:hover {
  color: #c47b00;
  border-color: #c47b00;
}

/* État : analyse indisponible */
.cdg-score-unavailable {
  color: #565959;
  font-size: 12px;
}

.cdg-score-unavailable a {
  color: #e47911;
  text-decoration: none;
  font-weight: 700;
}

.cdg-score-unavailable a:hover {
  text-decoration: underline;
}

/* ── 13. Bannière résultats de recherche ───────────────────────────────────── */

#cdg-search-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px 0;
  padding: 10px 14px;
  background: #fff8f0;
  border: 1px solid #f0c07a;
  border-left: 4px solid #e47911;
  border-radius: 6px;
  font-family: "Amazon Ember", Arial, sans-serif;
  box-sizing: border-box;
}

.cdg-banner-btn {
  background: #e47911;
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 7px 16px;
  font-family: "Amazon Ember", Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.cdg-banner-btn:hover {
  background: #c96a00;
}

.cdg-banner-count {
  font-size: 12px;
  color: #565959;
}
