/* Pièces Auto v2.0 — fitment surfaces (v2.1 accordion block at bottom) */

.tml-fit-badge {
  display: inline-block;
  margin: 8px 0;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}
.tml-fit-badge.tml-fit-ok { background: #dcfce7; color: #166534; border: 1px solid #16a34a; }
.tml-fit-badge.tml-fit-ko { background: #fee2e2; color: #991b1b; border: 1px solid #dc2626; }

.tml-fit-banner {
  background: #f5f7fa;
  border: 1px solid #dde3f0;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
}
.tml-fit-banner[data-state="no-vehicle"] { background: #fff7ed; border-color: #fdba74; }
.tml-fit-banner .tml-fit-toggle {
  display: flex; align-items: center; gap: 10px; cursor: pointer; margin: 0;
}
.tml-fit-banner .tml-fit-toggle input[type=checkbox] { transform: scale(1.1); margin: 0; }
.tml-fit-banner .tml-fit-link { color: #2563eb; text-decoration: none; font-weight: 600; }
.tml-fit-banner .tml-fit-link:hover { text-decoration: underline; }

/* v2.3.3 — garage-switch dropdown */
.tml-fit-banner[data-state="garage"] {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
}
.tml-fit-banner .tml-fit-label { font-weight: 600; color: #334155; }
.tml-fit-banner .tml-fit-select {
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  font: inherit;
  min-width: 200px;
  cursor: pointer;
}
.tml-fit-banner .tml-fit-select:focus { border-color: #ff9a16; outline: none; }
.tml-fit-banner .tml-fit-link-small { font-size: 12px; font-weight: 500; margin-left: auto; }

.tml-fit-picker select,
.tml-fit-picker .button { width: 100%; }
.tml-fit-picker .tml-fit-save { margin-top: 4px; }

@media (max-width: 640px) {
  .tml-fit-picker > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}

/* ────────────────────────────────────────────────────────────────────────────
 * Pièces Auto — v2.1 product-page details accordion
 * Targets the <section class="tml-pdet"> emitted by TML_Fitment::render_product_details().
 * Visual conventions:
 *   - border-radius 5px : match Flatsome global button radius
 *   - #ff9a16            : Tomobile brand accent (open-state border + OE brand label)
 * ──────────────────────────────────────────────────────────────────────────── */
.tml-pdet {
  margin: 1rem 0;
  font-size: 0.92em;
}
.tml-pdet-block {
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  margin-bottom: 0.5rem;
  background: #fff;
}
.tml-pdet-block summary {
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
  color: #333;
  list-style: none;
  border-radius: 5px;
}
.tml-pdet-block summary::-webkit-details-marker { display: none; }
.tml-pdet-block summary::after {
  content: "\25BE";
  float: right;
  transition: transform 0.15s ease;
}
.tml-pdet-block[open] summary::after { transform: rotate(180deg); }
.tml-pdet-block[open] { border-color: #ff9a16; }
.tml-pdet-specs {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 0.5rem;
}
.tml-pdet-specs th,
.tml-pdet-specs td {
  padding: 0.3rem 0.9rem;
  border-bottom: 1px solid #f0f0f0;
  text-align: left;
}
.tml-pdet-specs th {
  font-weight: 400;
  color: #666;
  width: 45%;
}
.tml-pdet-specs td { font-weight: 600; }
.tml-pdet-specs tr:last-child th,
.tml-pdet-specs tr:last-child td { border-bottom: 0; }
.tml-pdet-specs code {
  font-family: ui-monospace, monospace;
  font-size: 0.9em;
  color: #555;
}
.tml-pdet-oe {
  margin: 0 0 0.5rem;
  padding: 0.4rem 1.6rem;
  list-style: none;
  columns: 2;
  column-gap: 1.5rem;
}
.tml-pdet-oe li {
  padding: 0.15rem 0;
  font-size: 0.86em;
  break-inside: avoid;
}
.tml-pdet-oe li b {
  color: #ff9a16;
  font-weight: 600;
  margin-right: 0.3rem;
}
.tml-pdet-more {
  margin: 0;
  padding: 0.2rem 0.9rem 0.6rem;
  color: #888;
  font-size: 0.85em;
  font-style: italic;
}
@media (max-width: 600px) {
  .tml-pdet-oe { columns: 1; }
}

/* ────────────────────────────────────────────────────────────────────────────
 * Phase 3.0 — Reusable vehicle picker widget (.tml-vp-*)
 * Used by the rewritten /ajouter-vehicule template and (from 3.1+) by
 * homepage/shop/sidebar widgets via TmlVehiclePicker.mount().
 * ──────────────────────────────────────────────────────────────────────────── */
.tml-vp-card {
  background: #f5f7fa;
  border: 1px solid #dde3f0;
  border-radius: 8px;
  padding: 14px;
  margin: 0 0 18px;
}
.tml-vp-card-warn {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.4);
  color: #92400e;
  font-size: 13px;
}
.tml-vp-card-title {
  font-weight: 600;
  margin-bottom: 10px;
}
.tml-vp-help {
  font-size: 12px;
  color: #64748b;
  margin: 8px 0 0;
}

/* Picker row (cascade selects). Stacked = horizontal 3-col by default. */
.tml-vp-row {
  display: grid;
  gap: 8px;
}
.tml-vp-row.tml-vp-stacked {
  grid-template-columns: 1fr 1fr 1fr;
}
.tml-vp-row.tml-vp-compact {
  grid-template-columns: 1fr;
}
@media (max-width: 640px) {
  .tml-vp-row.tml-vp-stacked { grid-template-columns: 1fr; }
}
.tml-vp select {
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  font: inherit;
}
.tml-vp-status {
  margin-top: 8px;
  font-size: 13px;
  color: #16a34a;
  min-height: 18px;
}
.tml-vp-status.tml-vp-ok::before { content: "\2713 "; }

/* Fallback panel (free-text manual entry, behind opt-in) */
.tml-vp-fallback-row {
  margin: 4px 0 12px;
}
.tml-vp-fallback-toggle {
  font-size: 12px;
  color: #f59e0b;
  text-decoration: underline;
  cursor: pointer;
}
.tml-vp-fallback-toggle:hover { color: #b45309; }
.tml-vp-fallback-panel {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 6px;
  padding: 12px;
  margin: 0 0 14px;
}
.tml-vp-fallback-warn {
  font-size: 12px;
  color: #92400e;
  margin-bottom: 10px;
  line-height: 1.5;
}
.tml-vp-fallback-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.tml-vp-fallback-confirm input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* v2.2.7 — Disable button on the empty-results shop banner */
.tml-fit-clear {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.tml-fit-clear:hover { background: rgba(239, 68, 68, 0.18); }

/* v2.2.8 — VIN decoder card on /ajouter-vehicule */
.tml-vp-vin-card {
  background: #fff7e6;
  border: 1px solid #f5d99a;
  border-radius: 8px;
  padding: 14px;
  margin: 0 0 14px;
}
.tml-vp-vin-title {
  font-weight: 600;
  margin-bottom: 8px;
}
.tml-vp-vin-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.tml-vp-vin-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font: inherit;
  font-family: ui-monospace, monospace;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.tml-vp-vin-row input:focus { border-color: #ff9a16; outline: none; }
.tml-vp-vin-row button { white-space: nowrap; }
.tml-vp-vin-help {
  font-size: 11px;
  color: #92400e;
  margin-top: 6px;
}
.tml-vp-vin-status {
  margin-top: 10px;
  font-size: 13px;
  min-height: 18px;
  line-height: 1.4;
}
.tml-vp-vin-status.tml-vp-vin-ok      { color: #16a34a; }
.tml-vp-vin-status.tml-vp-vin-warn    { color: #b45309; }
.tml-vp-vin-status.tml-vp-vin-error   { color: #b91c1c; }
.tml-vp-vin-status.tml-vp-vin-loading { color: #64748b; font-style: italic; }

