/* Panier, Packs, Liste collée, Suggestions — habillage v2 (actif avec body.embed). */

/* ---------- Panier + Packs ---------- */
body.embed #page-recherche .split{gap:20px;align-items:flex-start}
body.embed #page-recherche .split-side{padding:22px;gap:12px}
body.embed #page-recherche .split-side h3{font-size:17px;margin:0}
body.embed #page-recherche .cart-list{gap:8px;max-height:none}
body.embed #page-recherche .cart-item,
body.embed #cart-item-modal .cart-item{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:10px 12px;gap:12px;font-size:14px;min-height:52px}
body.embed #page-recherche .cart-item:hover{border-color:var(--line-strong)}
body.embed #page-recherche .cart-item[draggable]{cursor:grab}
body.embed #page-recherche .cart-item[draggable]>span:first-child{color:var(--sub);opacity:.6;font-size:16px;line-height:1}
body.embed #page-recherche .cart-item .name{line-height:1.35;min-width:0}
body.embed #page-recherche .cart-item .name>div:first-child{font-weight:500}
body.embed .cart-thumb-click{border-radius:var(--radius-sm);overflow:hidden;border:1px solid var(--border);transition:border-color .15s}
body.embed .cart-thumb-click:hover{border-color:var(--accent)}
body.embed .qty-input{width:72px;text-align:center;min-height:38px}
body.embed .cart-remove,body.embed .liste-ok,body.embed .liste-bad,body.embed .liste-bind{flex:none}
body.embed .cart-remove:hover,body.embed .liste-bad:hover{background:var(--danger-soft);color:var(--danger);border-color:var(--danger)}
body.embed .liste-ok:hover{background:var(--ok-soft);color:var(--ok);border-color:var(--ok)}
body.embed #page-recherche .cart-suggestion{background:var(--accent-soft);border:1px solid transparent;border-radius:var(--radius-sm);margin:-2px 0 0 28px;padding:8px 12px;font-size:13px;color:var(--text)}
body.embed #page-recherche .cart-suggestion .muted{color:var(--text)}
body.embed #page-recherche .cart-suggestion .btn{border-color:var(--accent);color:var(--accent);background:var(--card)}
body.embed #page-recherche .cart-suggestion .cart-suggest-dismiss{border-color:transparent;background:transparent;color:var(--sub)}
body.embed #page-recherche .full{width:100%}
body.embed #btn-insert-cart{min-height:44px;font-size:15px}
body.embed #panier-pack-list .cart-item:hover{border-color:var(--accent);background:var(--accent-soft)}
body.embed #page-recherche .filters-row{display:flex;gap:8px;align-items:center}
body.embed #page-recherche .filters-row .input{flex:1;min-width:0}

/* ---------- Liste collée ---------- */
body.embed #page-liste .split{gap:20px;align-items:flex-start}
body.embed #page-liste .split-side{flex:0 1 360px!important;min-width:280px;padding:22px;position:sticky;top:8px}
body.embed #page-liste .split-main{flex:3 1 520px}
body.embed #liste-text{min-height:340px;font-size:14px;line-height:1.55;font-family:var(--mono,ui-monospace,Consolas,monospace);resize:vertical}
body.embed #page-liste .full{width:100%;min-height:44px}
body.embed #btn-analyze{font-size:15px}
body.embed #page-liste .table-card{overflow:visible;padding:0}
body.embed #liste-table{width:100%;border-collapse:separate;border-spacing:0}
body.embed #liste-table thead th{position:sticky;top:0;z-index:3;text-align:left;padding:12px 14px;background:var(--chip);box-shadow:0 1px 0 var(--border)}
body.embed #liste-table thead th:first-child{border-top-left-radius:var(--radius)}
body.embed #liste-table thead th:last-child{border-top-right-radius:var(--radius)}
body.embed #liste-table td{padding:14px;vertical-align:middle;line-height:1.4}
body.embed #liste-table td:nth-child(3){color:var(--sub);max-width:220px}
body.embed #liste-table th:nth-child(5),body.embed #liste-table td:nth-child(5){display:none}
body.embed #liste-table tr:hover td{background:transparent}
body.embed #liste-table tr[data-idx]:not(.liste-room):not(.liste-section):not(.liste-note):hover td{background:var(--chip)}
body.embed #liste-table .liste-status{min-width:150px}
body.embed #liste-table .liste-status input{width:18px;height:18px;margin-right:8px;accent-color:var(--accent)}
body.embed #liste-table .liste-status .badge{font-size:12.5px}
body.embed #liste-table .liste-actions{display:flex;gap:6px;align-items:center;justify-content:flex-end;flex-wrap:wrap;border-bottom:1px solid var(--border)}
body.embed #liste-table .liste-actions .icon-btn{width:36px;height:36px}
body.embed #liste-table .liste-skipped td{opacity:.5}
/* pièces : gros intertitres qui découpent la liste */
body.embed #liste-table .liste-room td{position:sticky;top:44px;z-index:2;background:var(--card);padding:26px 14px 10px;font-size:17px;border-bottom:2px solid var(--accent);color:var(--text)}
body.embed #liste-table tbody .liste-room:first-child td{padding-top:16px}
body.embed #liste-table .liste-section td{padding:10px 14px;background:var(--accent-soft);color:var(--accent);letter-spacing:.05em;text-transform:uppercase}
body.embed #liste-table .liste-note td{padding:8px 14px;border-bottom:0}
body.embed #page-liste .badge{white-space:nowrap}
body.embed #page-liste .badge.ok::before{content:"✓ "}
body.embed #page-liste .badge.warn::before{content:"? "}
body.embed #page-liste .badge.bad::before{content:"✕ "}
body.embed #page-liste .badge:not(.ok):not(.warn):not(.bad)::before{content:""}
/* récapitulatif et bouton d'insertion toujours visibles */
body.embed #page-liste .split-main>.card:last-child{position:sticky;bottom:12px;z-index:5;display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding:14px 20px;box-shadow:0 8px 24px rgba(20,30,40,.14);border-color:var(--line-strong)}
body.embed #page-liste .split-main>.card:last-child h3{margin:0}
body.embed #page-liste #liste-summary{flex:1;min-width:160px;margin:0;color:var(--text);font-weight:500}
body.embed #page-liste #liste-insert-progress{flex-basis:100%;margin:0}
body.embed #page-liste #btn-insert-liste{width:auto;min-width:220px;margin-left:auto}
body.embed #liste-suggest .cart-item{background:var(--chip)}

/* ---------- Suggestions (liaisons) ---------- */
body.embed #page-suggestions .toolbar-card{padding:16px 20px}
body.embed #sg-search{width:100%;max-width:520px;min-height:42px}
body.embed #sg-grid{grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:16px}
body.embed #sg-grid .product-card{background:var(--card);cursor:pointer}
body.embed #sg-grid .product-thumb{height:130px}
body.embed #sg-grid .product-body{padding:12px 14px 14px}
body.embed .sg-link-count{background:var(--accent);color:var(--accent-text);font-size:12px;font-weight:500;padding:3px 10px}
body.embed #sg-links-modal .cart-item,body.embed #sg-links-modal .sgl-link{background:var(--chip);border-radius:var(--radius-sm)}
body.embed .sg-compat-ok{color:var(--ok);font-weight:500}
body.embed .sg-compat-bad{color:var(--danger);font-weight:500}
body.embed .sg-direction-choice{font-size:14px;gap:18px}

/* popup détail produit */
body.embed #cart-item-modal .modal{max-width:640px}
body.embed #cim-photo img{border-radius:var(--radius);max-width:100%}
body.embed #cim-suggestions h4{font-size:14px;margin:14px 0 8px}

@media (max-width:820px){
  body.embed #page-liste .split-side{position:static;flex-basis:100%!important}
  body.embed #liste-table .liste-actions{justify-content:flex-start}
}

/* Liste : photo du produit trouvé (clic = fiche), bouton « C'est un produit » sur un titre */
body.embed .liste-match{display:flex;align-items:center;gap:12px;cursor:pointer;border-radius:var(--radius-sm);padding:4px;margin:-4px}
body.embed .liste-match:hover{background:var(--accent-soft)}
body.embed .liste-thumb{flex:none;width:56px;height:56px;border-radius:var(--radius-sm);background:var(--chip);border:1px solid var(--border);display:grid;place-items:center;overflow:hidden;font-size:22px}
body.embed .liste-thumb img{width:100%;height:100%;object-fit:cover}
body.embed .liste-match-txt{min-width:0;line-height:1.35}
body.embed .liste-sec2item{margin-left:12px;opacity:.75}
body.embed .liste-section:hover .liste-sec2item{opacity:1}

/* icône compacte (32 px) : la taille est imposée, quelle que soit la photo */
body.embed .liste-thumb{width:32px!important;height:32px!important;min-width:32px;max-width:32px;max-height:32px;font-size:16px;border-radius:6px}
body.embed .liste-thumb img{width:32px!important;height:32px!important;max-width:32px!important;max-height:32px!important;object-fit:cover}
body.embed .liste-match{gap:10px}
