/* ==========================================================================
   Izdvojena Orderlia sekcija: tekst, koraci levo, velika demonstracija desno.
   Koristi komponente iz hero.css (.screen__*, .panel, .tkt, .meter, .demo-pause).
   ========================================================================== */

.od { position: relative; isolation: isolate; overflow: hidden; overflow: clip; border-bottom: 1px solid var(--line); padding-block: clamp(64px, 9vw, 128px); }
.od__glow {
  position: absolute; left: 50%; top: 38%; width: min(1200px, 120vw); aspect-ratio: 1.6; transform: translateX(-40%); z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(46, 123, 255, .16), rgba(34, 211, 238, .05) 55%, transparent 75%);
}

/* ---- Uvod ---- */
.od__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); align-items: end; margin-bottom: clamp(40px, 6vw, 72px); }
.od__intro { display: grid; gap: var(--s-4); }
.od__title { font-size: clamp(2.3rem, 1.2rem + 3.4vw, 4rem); font-weight: 800; letter-spacing: -.035em; line-height: 1; }
.od__title-accent { display: block; margin-top: .25em; font-size: .62em; letter-spacing: -.02em; color: transparent; background: linear-gradient(92deg, #fff 0%, #9CCBFF 50%, var(--c-cyan) 100%); -webkit-background-clip: text; background-clip: text; }
.od__text { display: grid; gap: var(--s-5); }
.od__lead { font-size: var(--fs-md); color: var(--c-text-2); max-width: 36em; margin: 0; }
.od__features { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.od__features li { padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); font-size: .82rem; color: var(--c-text-2); background: rgba(7, 14, 34, .55); }
.od__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* ---- Demo okvir ---- */
.od__demo { display: grid; grid-template-columns: minmax(250px, 300px) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
.od__rail { display: grid; gap: var(--s-4); position: sticky; top: calc(var(--header-h) + 24px); }
.od__rail-title { margin: 0; font-family: var(--f-mono); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--c-muted); }
.od-steps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.od-step {
  position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; width: 100%; min-height: 44px;
  padding: 12px 14px; text-align: left; color: var(--c-text-2); cursor: pointer; overflow: hidden;
  background: rgba(7, 14, 34, .55); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color var(--t-fast), background-color var(--t-fast), color var(--t-fast), box-shadow var(--t);
  -webkit-tap-highlight-color: transparent;
}
.od-step:hover { border-color: var(--line-strong); color: var(--c-text); }
.od-step__n { grid-row: span 2; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-strong); font-family: var(--f-mono); font-size: .72rem; color: var(--c-muted); transition: inherit; }
.od-step__t { font-weight: 700; font-size: .92rem; color: inherit; }
.od-step__d { font-size: .78rem; color: var(--c-muted); }
.od-step.is-done .od-step__n { border-color: rgba(34, 211, 238, .5); color: var(--c-cyan); }
.od-step[aria-current="step"] { color: #fff; border-color: rgba(34, 211, 238, .7); background: linear-gradient(160deg, rgba(34, 211, 238, .1), rgba(46, 123, 255, .08)); box-shadow: 0 0 30px -10px rgba(34, 211, 238, .5); }
.od-step[aria-current="step"] .od-step__n { border-color: var(--c-cyan); background: rgba(34, 211, 238, .18); color: #fff; box-shadow: var(--glow-cyan); }
.od-step[aria-current="step"] .od-step__d { color: var(--c-text-2); }
.od-step__bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: linear-gradient(90deg, var(--c-blue), var(--c-cyan)); }
@media (prefers-reduced-motion: no-preference) {
  .od__demo.is-playing .od-step[aria-current="step"] .od-step__bar { animation: od-fill var(--od-dur, 3s) linear forwards; }
  .od__demo.is-held .od-step__bar { animation-play-state: paused !important; }
}
@keyframes od-fill { to { width: 100%; } }

.od-current { display: none; margin: 0; font-weight: 700; font-size: .95rem; color: var(--c-text); }
.od-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.od-controls .demo-pause { min-height: 44px; }
.demo-pause[data-state="paused"] .demo-pause__icon::before { left: 1px; width: 0; height: 0; border-radius: 0; background: none; border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent currentColor; }
.demo-pause[data-state="paused"] .demo-pause__icon::after { display: none; }
.od-replay__icon { font-size: 1rem; line-height: 1; }
.od__rail .pill--demo { justify-self: start; }

/* ---- Scena ---- */
.od-stage { position: relative; height: 680px; min-width: 0; }
.od-stage__orbit { position: absolute; inset: -3% -2% -2% -3%; width: 105%; height: 105%; pointer-events: none; overflow: visible; }
.od-stage__orbit path { fill: none; vector-effect: non-scaling-stroke; }
.od-orbit-path { stroke: rgba(34, 211, 238, .26); stroke-width: 1; }
.od-orbit-flow { stroke: var(--c-cyan); stroke-width: 1.5; stroke-dasharray: 3 14; opacity: .55; }
@media (prefers-reduced-motion: no-preference) {
  .od-orbit-flow { animation: orbit-flow var(--t-orbit) linear infinite; }
  .od-stage.is-held .od-orbit-flow { animation-play-state: paused; }
}

.od-screen, .od-phone, .od-stage .panel {
  position: absolute; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(18, 36, 80, .97), rgba(8, 15, 36, .98));
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .85);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.od-stage .is-active { border-color: rgba(34, 211, 238, .75); box-shadow: 0 0 0 1px rgba(34, 211, 238, .25), 0 0 40px -6px rgba(34, 211, 238, .45), 0 30px 70px -30px rgba(0, 0, 0, .85); }
.od-stage .is-active .panel__head .dot, .od-stage .is-active .od-phone__track .dot { background: var(--c-cyan); box-shadow: var(--glow-cyan); opacity: 1; }

/* Ekran restorana */
.od-screen { left: 21%; top: 0; width: 79%; z-index: 1; overflow: hidden; }
.od-nav { display: inline-flex; gap: 4px; font-size: .7rem; color: var(--c-muted); }
.od-nav span { padding: 3px 9px; border-radius: 6px; }
.od-nav .is-on { color: var(--c-text); background: rgba(46, 123, 255, .2); }
.od-toast { position: absolute; right: 14px; top: 52px; z-index: 2; display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; font-size: .74rem; font-weight: 600; color: #fff; border-radius: 9px; background: rgba(46, 123, 255, .9); box-shadow: var(--glow-blue); }
.od-toast .dot { background: #fff; }
.js .od-toast[data-at] { transform: translateY(-6px); }
.js .od-toast[data-at].is-on { transform: none; }
.od-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 16px 16px 18px 26%; }
.od-col { display: grid; gap: 9px; align-content: start; min-height: 250px; padding: 10px; border-radius: 10px; background: rgba(4, 8, 22, .45); }
.od-tkt { position: relative; }
.od-tkt span { font-size: .7rem; }
.od-badge { position: absolute; right: 8px; top: 8px; font-style: normal; font-family: var(--f-mono); font-size: .56rem; letter-spacing: .12em; text-transform: uppercase; color: var(--c-gold); }

/* Telefon gosta */
.od-phone { left: 0; top: 72px; width: 25%; min-width: 180px; z-index: 3; padding: 26px 14px 16px; display: grid; gap: 8px; border-radius: 28px; font-size: .74rem; }
.od-phone__notch { position: absolute; left: 50%; top: 9px; width: 54px; height: 6px; margin-left: -27px; border-radius: 6px; background: rgba(110, 160, 255, .22); }
.od-phone__top { display: flex; align-items: center; gap: 8px; font-family: var(--f-display); font-size: .82rem; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.od-phone__label { font-family: var(--f-mono); font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; color: var(--c-muted); margin-top: 2px; }
.od-line { display: flex; justify-content: space-between; gap: 8px; color: var(--c-text-2); }
.od-line b { color: var(--c-text); }
.od-line--muted { color: var(--c-muted); font-size: .68rem; }
.od-line--total { padding-top: 8px; border-top: 1px solid var(--line); color: var(--c-text); font-weight: 700; }
.od-phone__cta, .od-kitchen__status, .od-stack, .od-map .panel__foot { display: grid; }
.od-phone__cta > *, .od-kitchen__status > *, .od-stack > *, .od-map .panel__foot > * { grid-area: 1 / 1; align-self: center; }
.od-cta { display: grid; place-items: center; min-height: 38px; border-radius: 10px; font-weight: 700; font-size: .8rem; }
.od-cta--send { color: #fff; background: var(--grad-blue); box-shadow: var(--glow-blue); }
.od-cta--sent { color: var(--c-ok); border: 1px solid rgba(91, 227, 160, .45); background: rgba(91, 227, 160, .08); }
.od-phone__track { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(34, 211, 238, .08); border: 1px solid rgba(34, 211, 238, .3); font-size: .68rem; color: var(--c-text); }
.od-phone__track .dot { flex: none; background: var(--c-muted); opacity: .7; }

/* Kuhinja */
.od-stage .od-kitchen { right: 0; left: auto; top: 372px; width: 29%; z-index: 2; padding: 14px 16px; display: grid; gap: 9px; font-size: .78rem; }
.od-kitchen__status { margin-top: 4px; }
.od-accept, .od-state { display: grid; place-items: center; min-height: 36px; border-radius: 9px; font-weight: 700; font-size: .78rem; }
.od-accept { color: #fff; background: var(--grad-blue); }
.od-state { color: var(--c-cyan); border: 1px solid rgba(34, 211, 238, .45); background: rgba(34, 211, 238, .08); }
.od-state--ok { color: var(--c-ok); border-color: rgba(91, 227, 160, .45); background: rgba(91, 227, 160, .08); }
.od-meter.is-on { width: 72%; }
.od-kitchen.is-handed .od-meter { width: 100%; }

/* Mapa */
.od-stage .od-map { left: 25%; top: 372px; width: 44%; z-index: 2; padding: 14px 16px; display: grid; gap: 10px; font-size: .78rem; }
.od-map__view { position: relative; aspect-ratio: 400 / 220; border-radius: 10px; overflow: hidden; background: rgba(4, 10, 30, .85); border: 1px solid var(--line); }
.od-map__view svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.od-road { stroke: rgba(110, 160, 255, .15); stroke-width: 9; fill: none; }
.od-road--thin { stroke-width: 4; stroke: rgba(110, 160, 255, .09); }
.od-route { stroke: rgba(34, 211, 238, .45); stroke-width: 2; stroke-dasharray: 5 6; fill: none; }
.od-route-done { stroke: var(--c-cyan); stroke-width: 3; fill: none; stroke-dasharray: var(--len, 400) var(--len, 400); stroke-dashoffset: 0; }
.od-pin-rest { fill: #12306E; stroke: var(--c-text); stroke-width: 1.5; }
.od-pin-home { fill: var(--c-text); }
.od-pin-home-ring { fill: none; stroke: var(--c-text); opacity: .35; }
.od-driver { position: absolute; left: 10%; top: 81.8%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--c-gold); box-shadow: 0 0 0 5px rgba(255, 195, 41, .22), 0 0 16px rgba(255, 195, 41, .75); }
/* Završni položaj (smanjen pokret, ručno izabran korak, kraj) */
.od-driver.is-on.at-end { left: 90%; top: 18.2%; }
@media (prefers-reduced-motion: no-preference) {
  .od-stage.is-moving .od-driver.is-on.at-end { animation: od-drive var(--od-dur, 4.6s) linear both; }
  .od-stage.is-moving .od-route-done.is-on { animation: od-route var(--od-dur, 4.6s) linear both; }
  .od-stage.is-held .od-driver, .od-stage.is-held .od-route-done { animation-play-state: paused !important; }
}
@keyframes od-drive { 0% { left: 10%; top: 81.8%; } 25% { left: 28.75%; top: 65.9%; } 50% { left: 47.5%; top: 50%; } 75% { left: 69.7%; top: 37.5%; } 100% { left: 90%; top: 18.2%; } }
@keyframes od-route { from { stroke-dashoffset: var(--len, 400); } to { stroke-dashoffset: 0; } }

/* Sklapanje kad sekcija prvi put uđe u ekran */
.js .od-stage .od-screen, .js .od-stage .od-phone, .js .od-stage .panel { opacity: 0; transform: translateY(18px) scale(.985); }
.js .od-stage.is-ready .od-screen, .js .od-stage.is-ready .od-phone, .js .od-stage.is-ready .panel { opacity: 1; transform: none; transition: opacity var(--t-draw) var(--ease) var(--d, 0s), transform var(--t-draw) var(--ease) var(--d, 0s), border-color var(--t), box-shadow var(--t); }
.od-stage .od-screen { --d: .05s; } .od-stage .od-phone { --d: .2s; } .od-stage .od-kitchen { --d: .35s; } .od-stage .od-map { --d: .5s; }

/* ---- Prelomne tačke ---- */
@media (max-width: 1099px) {
  .od__head { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .od__demo { grid-template-columns: minmax(0, 1fr); }
  .od__rail { position: static; }
  .od-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .od-step { grid-template-columns: minmax(0, 1fr); row-gap: 6px; padding: 10px 12px; }
  .od-step__n { grid-row: auto; }
  .od-step__d { display: none; }
  .od-step__t { font-size: .82rem; line-height: 1.2; }
}
@media (max-width: 899px) {
  .od-stage { height: 640px; }
  .od-board { padding-left: 28%; }
  .od-stage .od-map { left: 22%; width: 48%; }
  .od-stage .od-kitchen { width: 30%; top: 400px; }
}
/* Telefon: koraci kao brojevi, prikazuje se samo element aktivnog koraka */
@media (max-width: 719px) {
  .od { padding-block: var(--s-8); }
  .od__actions .btn { flex: 1 1 auto; }
  .od-steps { gap: 6px; }
  .od-step { place-items: center; padding: 8px 4px; }
  .od-step__t { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .od-current { display: block; }
  .od-stage { height: auto; display: grid; }
  .od-stage__orbit { display: none; }
  .od-screen, .od-phone, .od-stage .panel { position: relative; inset: auto; width: auto; min-width: 0; left: auto; right: auto; top: auto; display: none; }
  .od-stage .is-active { display: grid; }
  .od-screen.is-active { display: block; }
  .od-phone { max-width: 300px; justify-self: center; width: 100%; }
  .od-board { padding: 12px; gap: 8px; }
  .od-col { min-height: 170px; padding: 6px; }
  .od-nav span:not(.is-on) { display: none; }
  .js .od-stage .od-screen, .js .od-stage .od-phone, .js .od-stage .panel { transform: none; }
}
