/* Saydali — Stock et commandes : proposition de commande interactive. */
.order-stage { place-content: stretch; }
.order-mock { position: relative; }
.oc-head { display: flex; justify-content: space-between; align-items: start; gap: .8rem; padding: .8rem .9rem .5rem; }
.oc-title { font-weight: 700; font-size: 1rem; }
.oc-status { display: flex; align-items: center; gap: .45rem; margin-block-start: .15rem; color: var(--green); font: 500 .72rem/1.3 var(--mono); }
.oc-spin { flex: none; inline-size: .7rem; block-size: .7rem; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 2px #2e685033; }
.order-mock.is-computing .oc-spin { background: none; border: 2px solid #2e685040; border-top-color: var(--green); animation: oc-spin .7s linear infinite; box-shadow: none; }
.oc-chip { flex: none; padding: .25rem .55rem; border: 1px solid var(--line); border-radius: 99px; background: #eef1e9; font-size: .72rem; font-weight: 700; color: var(--muted); }
.oc-table { inline-size: 100%; border-collapse: collapse; font-size: .86rem; }
.oc-table thead th { padding: .45rem .9rem; background: var(--forest); color: #d8e6dc; font: 500 .68rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: .05em; text-align: start; }
.oc-table thead th:nth-child(2) { text-align: center; }
.oc-table thead th:last-child { text-align: end; }
.oc-row { border-block-end: 1px solid #e3e7dd; transition: background-color .3s ease; }
.oc-row:nth-child(even) { background: #f7f9f4; }
.oc-row.is-bumped { background: #f3fad7; }
.oc-row > * { padding: .65rem .9rem; vertical-align: middle; }
.oc-row th { font-weight: 400; text-align: start; }
.oc-prod { display: flex; align-items: center; gap: .6rem; }
.oc-prod strong { display: block; font-size: .88rem; line-height: 1.25; }
.oc-prod small { color: var(--muted); font-size: .74rem; }
.oc-thumb {
  flex: none; inline-size: 2rem; block-size: 1.55rem; border: 1px solid #cfd9e3; border-radius: .2rem;
  background: linear-gradient(90deg, transparent 30%, #3b6fb0 30% 38%, transparent 38%), linear-gradient(#fff 55%, #dce8f5 55%);
}
.oc-stockline { display: flex; align-items: center; gap: .5rem; margin-block-start: .4rem; color: var(--muted); font: 500 .68rem/1.2 var(--mono); }
.oc-gauge { position: relative; flex: none; inline-size: 4.2rem; block-size: .38rem; border-radius: 99px; background: #e4e8df; overflow: hidden; }
.oc-gauge i { position: absolute; inset: 0 auto 0 0; inline-size: calc(var(--fill) * 100%); border-radius: inherit; background: #d9a23a; transform-origin: left; }
.oc-gauge--low i { background: #c4532f; }
.oc-gauge b { position: absolute; inset-block: 0; inset-inline-start: 50%; inline-size: 2px; background: var(--ink); opacity: .45; }
.oc-why {
  display: inline-flex; align-items: center; gap: .3rem; min-block-size: 2rem; margin-block-start: .25rem; padding: 0;
  border: 0; background: none; color: var(--green); font-size: .74rem; font-weight: 700; cursor: pointer;
}
.oc-why::before { content: "?"; display: grid; place-items: center; inline-size: 1rem; block-size: 1rem; border-radius: 50%; background: #e5efe2; font-size: .66rem; }
.oc-why[aria-expanded="true"]::before { content: "–"; background: var(--lime); }
.oc-reason { display: block; max-inline-size: 36ch; margin-block-start: .3rem; padding: .45rem .6rem; border-inline-start: 2px solid var(--lime); background: #f1f6e4; color: var(--ink); font-size: .76rem; line-height: 1.45; }
.oc-reason:not([hidden]) { animation: detail-in .3s var(--ease) both; }
.oc-edited { color: #8a5a00; font-style: normal; font-weight: 700; }
.oc-qty { text-align: center; }
.oc-stepper { display: inline-flex; align-items: center; gap: .25rem; padding: .18rem; border: 1px solid var(--line); border-radius: .45rem; background: #fff; }
.oc-step {
  display: grid; place-items: center; inline-size: 2.2rem; block-size: 2.2rem; border: 0; border-radius: .3rem;
  background: var(--forest); color: var(--lime); font-size: 1.05rem; font-weight: 700; cursor: pointer;
  transition: transform .15s ease, background-color .2s ease;
}
.oc-step:hover { background: var(--green); }
.oc-step:active { transform: scale(.9); }
.oc-step:disabled { opacity: .35; cursor: not-allowed; }
.oc-n { display: inline-block; min-inline-size: 2.2rem; font: 600 .95rem/1 var(--mono); text-align: center; }
.oc-n.is-tick { animation: oc-tick .35s var(--ease); }
.oc-line { text-align: end; white-space: nowrap; font: 500 .82rem/1.2 var(--mono); }
.oc-line small { color: var(--muted); font-size: .66rem; }
.oc-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .8rem 1.2rem; padding: .85rem .9rem .95rem; border-block-start: 1px solid var(--line); background: #fbfcf8; }
.oc-sums { display: grid; gap: .15rem; min-inline-size: 13rem; margin: 0; font-size: .8rem; }
.oc-sums div { display: flex; justify-content: space-between; gap: 1.4rem; }
.oc-sums dt { color: var(--muted); }
.oc-sums dd { margin: 0; font: 500 .8rem/1.4 var(--mono); }
.oc-ttc { padding-block-start: .2rem; border-block-start: 1px dashed var(--line); }
.oc-ttc dt { color: var(--ink); font-weight: 700; }
.oc-ttc dd { font-size: 1rem; font-weight: 600; color: var(--forest); }
.oc-sums .is-flash { animation: oc-flash .6s var(--ease); }
.oc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; }
.oc-reset { min-block-size: 2.75rem; padding: 0 .3rem; border: 0; background: none; color: var(--muted); font-size: .8rem; font-weight: 700; text-decoration: underline; text-underline-offset: .25em; cursor: pointer; }
.oc-reset:hover { color: var(--green); }
.oc-validate { min-block-size: 2.75rem; }
.oc-done {
  position: absolute; inset: 2.1rem 0 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: .55rem;
  padding: 1.5rem; background: #fbfcf8f2; backdrop-filter: blur(3px); text-align: center;
}
.oc-done[hidden] { display: none; }
.oc-done:not([hidden]) { animation: rise .45s var(--ease) both; }
.oc-done p { max-inline-size: 34ch; }
.oc-done-note { color: var(--muted); font-size: .8rem; }
.oc-check { position: relative; inline-size: 3.4rem; block-size: 3.4rem; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 .5rem #e4f78d55; }
.oc-check::after { content: ""; position: absolute; inset: .8rem 1.25rem 1.05rem; border: solid var(--forest); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.oc-done:not([hidden]) .oc-check { animation: oc-pop .55s .1s var(--ease) backwards; }
.order-stage figcaption { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 0 .4rem; }
.oc-capture { min-block-size: 2.2rem; font-size: .76rem; }
@media (max-width: 34rem) {
  .oc-table thead { display: none; }
  .oc-row { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .oc-row th { grid-column: 1 / -1; padding-block-end: .3rem; }
  .oc-row td { padding-block-start: .2rem; }
  .oc-qty { text-align: start; }
}
@media (prefers-reduced-motion: no-preference) {
  .order-mock.is-playing .oc-row { animation: ag-in .5s calc(.1s + var(--i) * .1s) var(--ease) backwards; }
  .order-mock.is-playing .oc-gauge i { animation: oc-fill 1s calc(.35s + var(--i) * .1s) var(--ease) backwards; }
  .oc-gauge--low i { animation: oc-warn 1.6s 1.6s ease-in-out infinite; }
}
@keyframes oc-spin { to { transform: rotate(360deg); } }
@keyframes oc-tick { 0% { transform: scale(1); } 40% { transform: scale(1.3); color: var(--green); } 100% { transform: scale(1); } }
@keyframes oc-flash { 0% { background: transparent; } 30% { background: #e4f78d; } 100% { background: transparent; } }
@keyframes oc-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes oc-warn { 50% { opacity: .45; } }
@keyframes oc-pop { from { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.1); opacity: 1; } to { transform: scale(1); } }
