/* Окно заказа — общее для всех страниц */
.od {
  --od-bg: #1b1a18;
  --od-card: #262421;
  --od-line: #3a3733;
  --od-text: #f4efe8;
  --od-muted: #a59d92;
  --od-accent: #f4661b;
  --od-accent-2: #ff8a3d;
  --od-bad: #ff6b5b;
  border: 0;
  padding: 0;
  width: min(480px, 100% - 24px);
  max-height: calc(100dvh - 24px);
  border-radius: 20px;
  background: var(--od-bg);
  color: var(--od-text);
  font: 15px/1.45 "Open Sans", "Inter", system-ui, sans-serif;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .06);
  overflow: auto;
  overscroll-behavior: contain;
}
.od[open] { animation: od-in .28s cubic-bezier(.2, .9, .3, 1.1); }
.od::backdrop { background: rgba(10, 8, 6, .7); backdrop-filter: blur(6px); }
@keyframes od-in { from { opacity: 0; transform: translateY(16px) scale(.97); } }
html.od-lock { overflow: hidden; }

.od-form { position: relative; padding: 24px 24px 20px; }
.od-close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, .06); cursor: pointer;
  display: grid; place-items: center; transition: background .2s;
}
.od-close:hover { background: rgba(255, 255, 255, .14); }
.od-close svg { width: 18px; height: 18px; stroke: var(--od-text); stroke-width: 2; stroke-linecap: round; }

.od-head { display: flex; gap: 14px; align-items: center; margin: 0 40px 20px 0; }
.od-img { width: 76px; height: 54px; object-fit: cover; border-radius: 8px; flex: none; background: #333; }
.od-kicker { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--od-accent-2); }
.od-title { margin: 2px 0 0; font: 600 16px/1.3 Montserrat, system-ui, sans-serif; }

.od-label { display: block; font-size: 13px; color: var(--od-muted); margin-bottom: 6px; }

.od-qty-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.od-stepper {
  display: inline-flex; align-items: center;
  background: var(--od-card); border: 1px solid var(--od-line); border-radius: 12px; overflow: hidden;
}
.od-stepper button {
  width: 44px; height: 46px; border: 0; background: none; color: var(--od-text);
  font-size: 22px; cursor: pointer; transition: background .15s;
}
.od-stepper button:hover { background: rgba(255, 255, 255, .07); }
.od-stepper input {
  width: 44px; height: 46px; border: 0; background: none; color: var(--od-text);
  text-align: center; font: 600 18px/1 inherit; -moz-appearance: textfield;
}
.od-stepper input::-webkit-inner-spin-button, .od-stepper input::-webkit-outer-spin-button { -webkit-appearance: none; }
.od-stepper input:focus { outline: none; }
.od-sum { text-align: right; }
.od-total { font: 700 28px/1.1 Montserrat, system-ui, sans-serif; color: var(--od-text); }
.od-each { font-size: 12.5px; color: #8fd18f; min-height: 18px; }

.od-tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 14px 0 18px; }
.od-tiers button {
  border: 1px solid var(--od-line); background: none; color: var(--od-muted);
  border-radius: 10px; padding: 7px 4px; font: 12px/1.3 inherit; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.od-tiers button b { display: block; font-size: 13.5px; color: var(--od-text); font-weight: 600; }
.od-tiers button:hover { border-color: #5a554e; }
.od-tiers button.on { border-color: var(--od-accent); background: rgba(244, 102, 27, .1); color: var(--od-accent-2); }

.od-field { display: block; margin-bottom: 14px; }
.od-field input, .od-field textarea, .od-more textarea {
  width: 100%; box-sizing: border-box;
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--od-line); background: var(--od-card); color: var(--od-text);
  font: inherit; font-size: 16px; line-height: 1.35; transition: border-color .15s, box-shadow .15s;
  resize: vertical;
}
.od-field input::placeholder, .od-field textarea::placeholder, .od-more textarea::placeholder { color: #6d675f; }
.od-field input:focus, .od-field textarea:focus, .od-more textarea:focus {
  outline: none; border-color: var(--od-accent); box-shadow: 0 0 0 3px rgba(244, 102, 27, .2);
}
.od-field.bad input, .od-field.bad textarea { border-color: var(--od-bad); }
.od-err { display: block; color: var(--od-bad); font-size: 12.5px; min-height: 0; margin-top: 4px; }
.od-err:empty { display: none; }

.od-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.od-seg label { cursor: pointer; }
.od-seg input { position: absolute; opacity: 0; pointer-events: none; }
.od-seg span {
  display: block; height: 100%; box-sizing: border-box;
  padding: 9px 8px; border-radius: 12px; border: 1px solid var(--od-line); background: var(--od-card);
  font-size: 11.5px; line-height: 1.3; color: var(--od-muted); text-align: center;
  transition: border-color .15s, background .15s;
}
.od-seg span b { display: block; font-size: 13.5px; color: var(--od-text); font-weight: 600; margin-bottom: 1px; }
.od-seg input:checked + span { border-color: var(--od-accent); background: rgba(244, 102, 27, .1); }
.od-seg input:focus-visible + span { box-shadow: 0 0 0 3px rgba(244, 102, 27, .3); }

.od-more { margin: 0 0 16px; }
.od-more summary { cursor: pointer; color: var(--od-muted); font-size: 13.5px; list-style: none; width: max-content; }
.od-more summary::before { content: "+ "; color: var(--od-accent-2); }
.od-more[open] summary::before { content: "− "; }
.od-more textarea { margin-top: 8px; }

.od-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.od-submit {
  position: relative; width: 100%; height: 56px; border: 0; border-radius: 14px; cursor: pointer;
  background: linear-gradient(180deg, var(--od-accent-2), var(--od-accent));
  color: #fff; font: 700 17px/1 Montserrat, system-ui, sans-serif; letter-spacing: .01em;
  box-shadow: 0 10px 24px rgba(244, 102, 27, .35);
  transition: transform .12s, box-shadow .2s, filter .2s;
}
.od-submit:hover { filter: brightness(1.06); box-shadow: 0 12px 30px rgba(244, 102, 27, .45); }
.od-submit:active { transform: translateY(1px) scale(.995); }
.od-submit:disabled { cursor: wait; }
.od-spinner {
  display: none; position: absolute; inset: 0; margin: auto; width: 22px; height: 22px;
  border: 3px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%;
  animation: od-spin .7s linear infinite;
}
.od-submit.loading .od-submit-text { visibility: hidden; }
.od-submit.loading .od-spinner { display: block; }
@keyframes od-spin { to { transform: rotate(1turn); } }

.od-note { margin: 10px 0 0; text-align: center; font-size: 12.5px; color: var(--od-muted); }
.od-fail { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(255, 107, 91, .12); color: #ffb3a9; font-size: 13.5px; }

.od-done { text-align: center; padding: 18px 6px 4px; }
.od-done h3 { font: 700 22px/1.25 Montserrat, system-ui, sans-serif; margin: 14px 0 6px; }
.od-done p { color: var(--od-muted); margin: 0 0 8px; }
.od-done .od-done-num { color: var(--od-text); font-weight: 600; }
.od-done .od-submit { margin-top: 16px; }
.od-check svg { width: 72px; height: 72px; fill: none; stroke: #6fcf7a; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.od-check circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: od-draw .6s ease-out forwards; }
.od-check path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: od-draw .4s .45s ease-out forwards; }
@keyframes od-draw { to { stroke-dashoffset: 0; } }

@media (max-width: 480px) {
  .od { width: 100%; max-width: 100%; max-height: 100dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
  .od[open] { animation-name: od-up; }
  @keyframes od-up { from { transform: translateY(40%); opacity: .5; } }
  .od-form { padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); }
  .od-tiers button { font-size: 11px; }
  .od-seg span { padding: 8px 4px; font-size: 10.5px; }
  .od-seg span b { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .od[open], .od-check circle, .od-check path { animation: none; stroke-dashoffset: 0; }
}

/* ---------- Список книг в заказе ---------- */
.od-head { display: block; margin: 0 40px 16px 0; }
.od-items { display: grid; gap: 8px; }
.od-item {
  display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: center;
  padding: 10px; border-radius: 14px; border: 1px solid var(--od-line); background: var(--od-card);
  transition: border-color .2s, background .2s, opacity .2s; opacity: .62;
}
.od-item.on { opacity: 1; border-color: rgba(244, 102, 27, .55); background: rgba(244, 102, 27, .07); }
.od-item img { width: 58px; height: 44px; object-fit: cover; border-radius: 8px; }
.od-item-info { min-width: 0; }
.od-item-info b { display: block; font: 600 14px/1.25 Montserrat, system-ui, sans-serif; }
.od-item-info span { font-size: 12px; color: var(--od-muted); }
.od-item .od-stepper button { width: 36px; height: 38px; font-size: 20px; }
.od-item output { width: 26px; text-align: center; font-weight: 700; font-size: 16px; }
.od-items-err { margin: 6px 0 0; }
.od-sumline {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 12px;
  margin: 14px 2px 18px; padding-top: 14px; border-top: 1px dashed var(--od-line);
}
.od-sumline > span { color: var(--od-muted); font-size: 14px; }
.od-submit.off { filter: grayscale(.6) brightness(.8); box-shadow: none; }
@media (max-width: 480px) {
  .od-item { grid-template-columns: 46px 1fr auto; gap: 10px; padding: 8px; }
  .od-item img { width: 46px; height: 36px; }
  .od-item-info b { font-size: 13px; }
}
.od-note a { color: var(--od-accent-2); }

/* Заявка на печать: без корзины и доставки */
.od [hidden] { display: none !important; }
.od-lead { margin: 0 0 20px; color: var(--od-muted); font-size: 14px; line-height: 20px; }
