/* Ice Occasion — bloc déstockage de la fiche neuve + bandeau de la fiche unité.
   Couleurs du thème (assets/css/mh-layout.css), avec repli. */

.ioc {
  position: relative;
  margin: 22px 0 0;
  padding: 14px 12px 12px;
  background: linear-gradient(180deg, #fff6ea 0, #fff 56px);
  border: 1px solid #f4e2c9;
  border-radius: 18px;
}
.ioc[hidden] { display: none; }

/* Badge « PRO uniquement » à cheval sur le bord */
.ioc__pro {
  position: absolute;
  top: -11px;
  right: 16px;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 4px 10px 4px 9px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff;
  background: var(--mh-navy, #0c193a);
  border-radius: 999px;
  box-shadow: 0 4px 10px -4px rgba(12, 25, 58, 0.45);
}

/* En-tête */
.ioc__head {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 0 0 10px;
}
.ioc__icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: #c2410c;
  background: #fff;
  border-radius: 9px;
  box-shadow: 0 0 0 1px #f4e2c9;
}
.ioc__title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--mh-navy, #0c193a);
}

.ioc__list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Une pièce = une carte blanche */
.ioc__unit {
  padding: 10px;
  background: #fff;
  border: 1px solid var(--mh-line, #e8ebf0);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(12, 25, 58, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.2s ease;
}
.ioc__unit:hover {
  border-color: #f2c9a8;
  box-shadow: 0 8px 22px -12px rgba(12, 25, 58, 0.28);
}
.ioc__unit[hidden] { display: none; }

.ioc__top {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.ioc__media {
  position: relative;
  width: 68px;
  height: 68px;
  padding: 0;
  overflow: hidden;
  background: var(--mh-soft, #f5f7fa);
  border: 0;
  border-radius: 12px;
  cursor: zoom-in;
}
.ioc__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.ioc__media:hover img { transform: scale(1.07); }
.ioc__count {
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: inline-flex;
  gap: 3px;
  align-items: center;
  padding: 2px 6px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  background: rgba(12, 25, 58, 0.72);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.ioc__body { min-width: 0; }
.ioc__badges { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 0 0 4px; }

.ioc__grade,
.ioc__unique {
  display: inline-block;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 6px;
}
.ioc__grade { color: var(--mh-navy, #0c193a); background: #eef1f6; }
.ioc__grade--like_new { color: #116329; background: #dcf2e3; }
.ioc__grade--good { color: #0b4f8a; background: #e1ecfa; }
.ioc__grade--damaged { color: #9a4a00; background: #fde9cc; }
.ioc__grade--for_parts { color: #8f1d1d; background: #fbe0e0; }
.ioc__unique { color: var(--mh-text, #5b6475); background: var(--mh-soft, #f5f7fa); }

/* Le nom sert au tiroir panier ; à l'écran, le défaut est l'information utile. */
.ioc__name {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ioc__defect {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--mh-navy, #0c193a);
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.ioc__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  align-items: baseline;
  margin: 3px 0 0;
  font-size: 12px;
}
.ioc__photos {
  padding: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--mh-orange-dark, #cf4419);
  background: none;
  border: 0;
  cursor: pointer;
}
.ioc__photos::after { content: ' →'; display: inline-block; transition: transform 0.15s ease; }
.ioc__photos:hover::after { transform: translateX(2px); }
.ioc__ref { color: var(--mh-muted, #8a93a5); }

/* Prix + bouton */
.ioc__buy {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  justify-content: space-between;
  margin: 10px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid var(--mh-line, #e8ebf0);
}
.ioc__prices { min-width: 0; }
.ioc__price {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  align-items: center;
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--mh-orange, #e65021);
}
.ioc__price small { font-size: 11px; font-weight: 700; letter-spacing: 0; color: var(--mh-text, #5b6475); }
.ioc__off {
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0;
  color: #fff;
  background: var(--mh-orange, #e65021);
  border-radius: 6px;
}
.ioc__new { margin: 2px 0 0; font-size: 11.5px; line-height: 1.4; color: var(--mh-muted, #8a93a5); }
.ioc__new b { display: block; font-weight: 700; white-space: nowrap; color: var(--mh-green, #1f9d55); }
.ioc__new s { white-space: nowrap; }

.ioc__form { flex: 0 0 auto; margin: 0; }
.ioc__add {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 15px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--mh-orange-dark, #cf4419);
  background: #fff1ea;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.ioc__add:hover,
.ioc__add:focus-visible {
  color: #fff;
  background: var(--mh-orange, #e65021);
  box-shadow: 0 6px 14px -6px rgba(230, 80, 33, 0.6);
}
.ioc__add:active { transform: scale(0.97); }
.ioc__add:disabled,
.ioc__add:disabled:hover { color: var(--mh-muted, #8a93a5); background: var(--mh-soft, #f5f7fa); box-shadow: none; cursor: not-allowed; }

/* Conditions (pros, ni garantie ni reprise) */
.ioc__terms {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  align-items: center;
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--mh-text, #5b6475) !important;
  text-decoration: none !important;
}
.ioc__terms:hover span { text-decoration: underline; }
.ioc__terms svg { flex: 0 0 auto; color: var(--mh-muted, #8a93a5); }
.ioc__blocked {
  margin: 10px 0 0;
  padding: 8px 10px;
  font-size: 12.5px;
  line-height: 1.4;
  color: #8a4b00;
  background: #fdf0dc;
  border-radius: 10px;
}

/* HT / TTC : même bascule que le prix principal (html.mh-tax-incl). */
.ioc [data-mh-tax='incl'] { display: none; }
html.mh-tax-incl .ioc [data-mh-tax='excl'] { display: none; }
html.mh-tax-incl .ioc [data-mh-tax='incl'] { display: inline; }

.ioc__more {
  width: 100%;
  margin: 10px 0 0;
  padding: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--mh-navy, #0c193a);
  background: #f5f6f8;
  border: 1px solid var(--mh-line, #e8ebf0);
  border-radius: 12px;
  cursor: pointer;
}

/* Galerie */
.ioc__dialog {
  width: min(92vw, 820px);
  max-height: 92vh;
  padding: 16px;
  border: 0;
  border-radius: 16px;
}
.ioc__dialog::backdrop { background: rgba(12, 25, 58, 0.6); }
.ioc__close {
  position: absolute;
  top: 6px;
  right: 10px;
  width: 36px;
  height: 36px;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--mh-navy, #0c193a);
  background: none;
  border: 0;
  cursor: pointer;
}
.ioc__stage { margin: 24px 0 10px; text-align: center; }
.ioc__stage img { max-width: 100%; max-height: 66vh; object-fit: contain; }
.ioc__thumbs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ioc__thumbs[hidden] { display: none; }
.ioc__thumbs button {
  width: 60px;
  height: 60px;
  padding: 0;
  overflow: hidden;
  background: #f5f6f8;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}
.ioc__thumbs button[aria-current='true'] { border-color: var(--mh-orange, #e65021); }
.ioc__thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* Fiche d'une unité, en tête de la boîte d'achat (unit-buy.tpl) */
.ioc-buyhead {
  margin: 0 0 16px;
  padding: 10px 12px 11px;
  background: linear-gradient(180deg, #fff3e3 0, #fff8ef 100%);
  border: 1px solid #f4e2c9;
  border-radius: 14px;
}
.ioc-buyhead p { margin: 0; }
.ioc-buyhead__tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ioc-buyhead__kind,
.ioc-buyhead__pro {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 4px 10px 4px 9px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  border-radius: 999px;
}
.ioc-buyhead__kind { color: #fff; background: var(--mh-orange, #e65021); }
.ioc-buyhead__pro { color: #fff; background: var(--mh-navy, #0c193a); }
.ioc-buyhead__state { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 9px !important; }
.ioc-buyhead__terms { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--mh-navy, #0c193a) !important; text-decoration: underline !important; text-underline-offset: 2px; }
.ioc-buyhead__incart { margin-top: 8px !important; padding: 6px 9px; font-size: 12.5px; font-weight: 600; line-height: 1.4; color: #116329; background: #dcf2e3; border-radius: 9px; }
.ioc-buyhead__incart[hidden] { display: none; }
.ioc-buyhead__incart a { color: inherit !important; text-decoration: underline !important; white-space: nowrap; }

/* Fiche d'une unité, sous la boîte d'achat : proposition du neuf (unit-banner.tpl) */
.ioc-alt { margin: 16px 0 0; }
.ioc-alt__title { margin: 0 0 8px 4px; font-size: 13px; font-weight: 700; color: var(--mh-navy, #0c193a); }
.ioc-alt [data-mh-tax='incl'] { display: none; }
html.mh-tax-incl .ioc-alt [data-mh-tax='excl'] { display: none; }
html.mh-tax-incl .ioc-alt [data-mh-tax='incl'] { display: inline; }

/* Lien vers le neuf : vignette, nom, prix */
.ioc-new {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px 8px 8px;
  color: var(--mh-navy, #0c193a) !important;
  text-decoration: none !important;
  background: #fff;
  border: 1px solid var(--mh-line, #e8ebf0);
  border-radius: 14px;
  transition: border-color 0.15s ease, box-shadow 0.2s ease;
}
.ioc-new:hover { border-color: #f0c9a0; box-shadow: 0 6px 16px -10px rgba(12, 25, 58, 0.35); }
.ioc-new__img { width: 52px; height: 52px; object-fit: contain; background: #fff; border-radius: 10px; box-shadow: 0 0 0 1px var(--mh-line, #e8ebf0); }
.ioc-new__body { display: grid; gap: 1px; min-width: 0; }
.ioc-new__label { display: flex; gap: 6px; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--mh-muted, #8a93a5); }
.ioc-new__label .ioc__off { padding: 1px 5px; font-size: 10.5px; }
.ioc-new__name { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 13px; font-weight: 700; line-height: 1.3; }
.ioc-new__price { font-size: 13px; font-weight: 800; line-height: 1.4; color: var(--mh-navy, #0c193a); }
.ioc-new__price small { font-size: 10.5px; font-weight: 700; color: var(--mh-text, #5b6475); }
.ioc-new__price b { font-weight: 700; color: var(--mh-green, #1f9d55); white-space: nowrap; }
.ioc-new__price s { white-space: nowrap; }
.ioc-new__go { color: var(--mh-orange, #e65021); transition: transform 0.15s ease; }
.ioc-new:hover .ioc-new__go { transform: translateX(2px); }
