@font-face { font-family: 'a_AntiqueTrady'; src: url('../fonts/antiquetrady.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; } /* §10.237 - registered at 400 so bold SYNTHESIZES (at 700 the browser matched exactly and never emboldened) */
@font-face { font-family: 'Adventure'; src: url('../fonts/adventure.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
.engrave-app { max-width: 960px; margin: 0 auto; }
.engrave-testbadge { background: #e7f3fe; border: 1px solid #b6d9f7; color: #15517e; border-radius: 6px; padding: .5rem .75rem; font-size: .9rem; margin-bottom: .75rem; }
.engrave-head { font-size: .8rem; color: #888; margin-bottom: .5rem; }
.engrave-help { background: #fbfaf5; border: 1px solid #efe9d6; border-radius: 8px; padding: .75rem 1rem; margin-bottom: 1rem; font-size: .92rem; }
.engrave-help ol { margin: .5rem 0 0; padding-left: 1.25rem; }
.engrave-help li { margin-bottom: .35rem; }
.engrave-help code { background: #efe9d6; padding: 0 .25rem; border-radius: 3px; }
.engrave-grid { display: flex; flex-wrap: wrap; gap: 1.25rem; }
/* §10.187 — preview lives INSIDE the controls column (between steps ③ and ④). */
.engrave-preview { flex: 0 0 auto; width: 100%; }
.engrave-stage { background: #f4f6f8; border: 1px solid #e0e4e8; border-radius: 8px; padding: .75rem; max-width: 940px; margin: 0 auto; }
.engrave-stage svg { width: 100%; height: auto; display: block; }
.engrave-text { user-select: none; }
.engrave-hint { margin: .5rem 0 .25rem; font-size: .85rem; color: #777; text-align: center; }
/* §10.187 — the undo/redo/centre/clear bar lives INSIDE the stage card (one visual unit). */
.engrave-preview-tools { display: flex; justify-content: center; align-items: center; gap: .35rem; flex-wrap: wrap; margin: .5rem 0 0; padding: .25rem 0 0; border-top: 1px solid #e0e4e8; }
.engrave-preview-tools .btn { text-decoration: none; }
.engrave-preview-tools .btn[disabled] { opacity: .4; }
.engrave-stage { box-shadow: inset 0 0 0 1px rgba(0,0,0,.03); }
.engrave-fit { margin: 0; font-size: .9rem; text-align: center; }
.engrave-fit.ok { color: #2e7d32; }
.engrave-fit.bad { color: #c0392b; }
.engrave-range { width: 100%; }
.engrave-lib { margin-top: .5rem; }
.engrave-lib-label { font-size: .85rem; color: #666; margin-bottom: .25rem; }
.engrave-lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: .4rem; margin-top: .4rem; }
.engrave-lib-icon { border: 1px solid #d6dade; background: #fff; border-radius: 6px; padding: .3rem; cursor: pointer; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.engrave-lib-icon:hover { border-color: #5b9bd5; background: #f0f7ff; }
.engrave-lib-icon svg { width: 100%; height: 100%; }
.engrave-names-remove, .engrave-icon-clear { color: #c0392b; }
.engrave-result { font-size: .9rem; }
.engrave-result.ok { color: #2e7d32; }
.engrave-result.bad { color: #c0392b; }

/* §10.171 — four step-section cards in one column (was a 2-col grid + a wall of help text): each
 * step reads top-to-bottom with its own bordered card, so the editor navigates itself. */
.engrave-controls {
  flex: 1 1 100%;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.engrave-controls .form-group { margin-bottom: 0; }
.engrave-sec {
  border: 1px solid #e3e7eb; border-radius: 10px;
  padding: .8rem .9rem; background: #fff;
}
.engrave-sec-title {
  display: flex; align-items: center; gap: .4rem;
  margin: 0 0 .6rem; font-size: 1rem; font-weight: 700;
}
.engrave-sec-opt { font-size: .78rem; font-weight: 400; color: #8a939c; margin-left: .25rem; }
.engrave-sec-final { border-color: #cfe0f5; background: #f7faff; }
.engrave-sec .form-group + .form-group { margin-top: .6rem; }
.engrave-names-wrap { margin-top: .6rem; }
.engrave-charwarn { margin-top: .6rem; }
.engrave-actions { display: flex; gap: 1rem; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 640px) {
  .engrave-sec { padding: .65rem .7rem; }
  /* §10.232 - submit stays RIGHT on phones: a chat bubble overlays the bottom-left corner */
  .engrave-actions { justify-content: flex-end; }
  .engrave-actions .engrave-submit { margin-left: auto; }
}

/* §10.163 A6 — numbered step badges */
.engrave-step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; margin-right: .1rem; flex: 0 0 auto;
  border-radius: 50%; background: #1f5fcf; color: #fff;
  font-size: .85rem; font-weight: 700; line-height: 1;
}

/* §10.163 A3 — character/glyph validation warning + counter */
.engrave-charwarn {
  background: #fdecea; border: 1px solid #f5c6cb; color: #a02622;
  border-radius: 6px; padding: .5rem .75rem; font-size: .88rem;
}
.engrave-counter { font-size: .78rem; color: #888; text-align: right; margin-top: .15rem; }

/* §10.179 — in-modal colour picker (§10.187: moved into section ① „Цвят и шрифт") */
.engrave-colours {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  margin: 0 0 .6rem; font-size: .9rem;
}
.engrave-colours-label { color: #555; font-weight: 600; }
.engrave-colours-list { display: flex; gap: .35rem; flex-wrap: wrap; }
.engrave-swatch {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid #d6dade;
  cursor: pointer; padding: 0; font-size: .6rem; color: #444; overflow: hidden;
  background: #eee;
}
.engrave-swatch.selected { border-color: #1f5fcf; box-shadow: 0 0 0 2px rgba(31,95,207,.35); }
.engrave-swatch.oos { opacity: .35; cursor: not-allowed; }
@media (pointer: coarse) { .engrave-swatch { width: 36px; height: 36px; } }

/* §10.178 (4) — cart-line design thumbnail */
.artengrave-cart-thumb {
  max-width: 260px; max-height: 56px; display: block;
  border: 1px solid #e0e4e8; border-radius: 6px; margin: .3rem 0;
}

/* §10.178 — live price line + names count badge */
.engrave-price {
  font-size: 1.05rem; margin-bottom: .6rem; padding: .45rem .7rem;
  background: #eef7ee; border: 1px solid #cde5cd; border-radius: 6px; color: #1e5c1e;
}
.engrave-names-count { font-size: .8rem; color: #1f5fcf; font-weight: 700; }

/* §10.164 A4 — per-name preview navigation + proof-approval confirm */
.engrave-namenav {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  margin: .35rem auto 0; max-width: 940px; font-size: .92rem;
}
.engrave-namenav .btn { text-decoration: none; font-size: 1.1rem; line-height: 1; }
.engrave-namenav .btn[disabled] { opacity: .35; }
.engrave-name-label { min-width: 7.5rem; text-align: center; font-weight: 600; }
.engrave-confirm {
  display: flex; align-items: flex-start; gap: .5rem; margin: 0;
  font-size: .9rem; font-weight: 400; cursor: pointer; flex: 1 1 100%;
}
.engrave-confirm input { margin-top: .2rem; width: 1.1rem; height: 1.1rem; flex: 0 0 auto; }
.engrave-actions { flex-wrap: wrap; }

/* §10.164 A1 — progressive disclosure for the icon panel */
.engrave-icon-panel { margin-top: .5rem; padding: .6rem; border: 1px solid #e0e4e8; border-radius: 8px; background: #fafbfc; }
.engrave-upload-label { display: block; margin: .6rem 0 0; font-size: .85rem; color: #666; }

/* §10.164 A1 — mobile-first: sticky preview above the keyboard, ≥44px touch targets */
@media (max-width: 640px) {
  /* §10.187b — operator: no sticky preview on phones; it flows INLINE between steps ③ and ④
   * exactly like desktop (previous sticky-above-keyboard behaviour removed on request). */
  .engrave-stage { padding: .4rem; }
  .engrave-preview-tools { margin: .25rem auto; padding: .15rem; }
  .engrave-help { font-size: .85rem; }
}
@media (pointer: coarse) {
  .engrave-preview-tools .btn, .engrave-namenav .btn,
  .engrave-addvar, .engrave-addline, .engrave-icon-open,
  .engrave-lib-icon, .engrave-submit { min-height: 44px; }
  .engrave-range { height: 2rem; }
  .engrave-font { font-size: 1.05rem; min-height: 44px; }
  .engrave-lib-grid { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); }
}

/* §10.168 — product-page CTA + dependency-free overlay modal (no bootstrap-JS coupling) */
.artengrave-cta { margin: .75rem 0; }
.artengrave-cta .artengrave-open { width: 100%; font-weight: 600; }
.artengrave-cta-note { margin: .4rem 0 0; font-size: .85rem; color: #856404; }
.artengrave-cta-note.ok { color: #2e7d32; font-weight: 600; }
.artengrave-overlay {
  position: fixed; inset: 0; z-index: 1050;
  background: rgba(20, 24, 30, .55);
  display: flex; align-items: center; justify-content: center; padding: 1.25rem;
}
.artengrave-overlay[hidden] { display: none; }
.artengrave-dialog {
  background: #fff; border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.3);
  width: 100%; max-width: 1000px; max-height: 92vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.artengrave-dialog-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; border-bottom: 1px solid #e6e9ec; font-size: 1.05rem;
}
.artengrave-close {
  border: 1px solid #d6dade; background: #f6f7f9; border-radius: 8px;
  font-size: 1.15rem; line-height: 1; cursor: pointer;
  min-width: 44px; min-height: 44px; padding: .25rem .5rem; color: #444;
}
.artengrave-close:hover { background: #ecEEF2; }
.artengrave-dialog-body { overflow-y: auto; padding: 1rem; -webkit-overflow-scrolling: touch; }
body.artengrave-modal-open { overflow: hidden; }
@media (max-width: 640px) {
  /* A1: fullscreen on phones — the sticky preview then rides the dialog-body scroll */
  .artengrave-overlay { padding: 0; }
  .artengrave-dialog { max-width: none; max-height: none; height: 100%; border-radius: 0; }
  .artengrave-dialog-body { padding: .6rem; }
}

/* §10.163 A6 — one-time onboarding hint over the preview */
.engrave-stage { position: relative; }
.engrave-firsthint {
  position: absolute; left: 50%; top: 12%; transform: translateX(-50%);
  background: rgba(31, 95, 207, .92); color: #fff; border-radius: 999px;
  padding: .4rem .9rem; font-size: .85rem; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,.25); cursor: pointer; z-index: 3;
  animation: engrave-hint-pulse 1.6s ease-in-out infinite;
}
@keyframes engrave-hint-pulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-52%) scale(1.03); }
}

/* §10.186 — fixed-text qty stepper */
.engrave-qty-row { display: flex; gap: .4rem; align-items: stretch; max-width: 220px; }
.engrave-qty-row .engrave-qty { text-align: center; -moz-appearance: textfield; }
.engrave-qty-row .engrave-qty::-webkit-outer-spin-button,
.engrave-qty-row .engrave-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.engrave-qty-row .btn { min-width: 44px; font-size: 1.2rem; line-height: 1; }
.engrave-qty-hint { display: block; margin-top: .3rem; color: #777; }

/* §10.187c — phones: the undo/redo/centre/clear bar fits ONE row (smaller buttons, no wrap).
 * Placed last so it overrides the pointer:coarse 44px min-height. */
@media (max-width: 640px) {
  .engrave-preview-tools { flex-wrap: nowrap; gap: .15rem; }
  .engrave-preview-tools .btn {
    font-size: .78rem; padding: .3rem .3rem; min-height: 36px; white-space: nowrap;
  }
}

/* §10.190 - post-save summary (colour / count / total / rendered design) before add-to-cart */
.artengrave-summary { padding: .5rem .25rem; }
.artengrave-summary h4 { margin: 0 0 .75rem; color: #2e7d32; }
.artengrave-summary-img {
  display: block; max-width: 100%; border: 1px solid #e0e4e8; border-radius: 8px;
  background: #f4f6f8; margin-bottom: .75rem;
}
.artengrave-summary-list { list-style: none; margin: 0 0 1rem; padding: 0; font-size: 1.05rem; }
.artengrave-summary-list li { margin-bottom: .35rem; }
.artengrave-summary-actions { display: flex; gap: .75rem; justify-content: space-between; flex-wrap: wrap; }
.artengrave-summary-actions .btn { min-height: 44px; }

/* §10.191 - pending-design rows under the product-page CTA */
.artengrave-designs { margin-top: .75rem; border: 1px solid #e3e7eb; border-radius: 10px; padding: .6rem .75rem; background: #fff; }
.artengrave-designs-title { font-weight: 700; margin-bottom: .4rem; }
.artengrave-design-row { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-top: 1px solid #eef1f4; }
.artengrave-design-row:first-of-type { border-top: 0; }
/* §10.207 - the DESIGN is the hero of the row: big thumbnail, compact right-aligned info */
.artengrave-design-row img { flex: 1 1 auto; min-width: 0; width: auto; max-width: 100%; max-height: 62px; object-fit: contain; border: 1px solid #e0e4e8; border-radius: 5px; background: #f4f6f8; }
.artengrave-design-info { display: flex; flex-direction: column; gap: .1rem; font-size: .78rem; color: #555; min-width: 0; flex: 0 0 auto; margin-left: auto; text-align: right; }
.artengrave-design-note { color: #777; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artengrave-design-actions { flex: 0 0 auto; display: flex; gap: .1rem; }
.artengrave-design-actions .btn { padding: .2rem .45rem; font-size: 1rem; text-decoration: none; min-height: 40px; }
.js-artengrave-row-del { color: #c0392b; }
.artengrave-designs-total { margin-top: .5rem; padding-top: .45rem; border-top: 1px solid #e3e7eb; font-size: 1rem; }

/* §10.192 - designer / manual-design tabs */
.engrave-tabs { display: flex; gap: .4rem; margin-bottom: .75rem; border-bottom: 2px solid #e3e7eb; }
.engrave-tab {
  border: 0; background: none; padding: .55rem .9rem; font-size: .95rem; font-weight: 600;
  color: #667; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; min-height: 44px;
}
.engrave-tab.active { color: #1f5fcf; border-bottom-color: #1f5fcf; }
.engrave-manual-intro { background: #fbfaf5; border: 1px solid #efe9d6; border-radius: 8px; padding: .75rem 1rem; font-size: .92rem; }
.engrave-manual .engrave-colours { margin: .5rem 0 .75rem; }
.engrave-manual-note { resize: vertical; }

/* §10.209 - manual tab: air between the pcs selector and the price line */
.engrave-manual-price { margin-top: .9rem; }

/* §10.212 - cart line: the engraving block is a REAL separate row under Премахване */
.product-line__actions { flex-wrap: wrap; }
.artengrave-cart-block {
  display: block; flex-basis: 100%; width: 100%;
  margin-top: .6rem; padding-top: .55rem; border-top: 1px dashed #dfe3e8;
}

/* §10.212 - long-text split suggestion */
.engrave-split-hint {
  background: #e7f3fe; border: 1px solid #b6d9f7; color: #15517e;
  border-radius: 6px; padding: .5rem .75rem; font-size: .88rem; margin-top: .6rem;
}
.engrave-split-hint .btn { margin-left: .35rem; }

/* §10.230 - B/I/U style buttons (gated by ARTENGRAVE_STYLES) */
.engrave-style-btns { margin-top: .5rem; font-size: .85rem; color: #666; }
.engrave-style-btns .btn { min-width: 40px; min-height: 38px; font-size: 1rem; }

/* §10.236 - Шрифт + Стил side by side; wraps to stacked when too narrow (small phones) */
.engrave-font-row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.engrave-font-row .form-group { flex: 1 1 150px; min-width: 150px; margin-bottom: 0; }
/* §10.238c - equal control heights: the two selects render in different fonts, which skews their
   intrinsic heights - pin them (44px matches the coarse-pointer rule for .engrave-font) */
.engrave-font-row .engrave-dd-btn { height: 48px; }

/* §10.239 - custom dropdowns (font + style): options preview their own font/weight on EVERY
   device (native phone pickers ignore option styling) */
.engrave-dd { position: relative; }
.engrave-dd-btn {
  width: 100%; height: 48px; text-align: left; background: #fff;
  border: 1px solid #ced4da; border-radius: .25rem; padding: .375rem 2rem .375rem .75rem;
  position: relative; cursor: pointer; overflow: hidden; white-space: nowrap;
  font-size: 1.35rem; /* §10.239b - the typeface must READ in the preview */
}
.engrave-dd-btn::after {
  content: ''; position: absolute; right: .75rem; top: 50%; transform: translateY(-30%);
  border: 5px solid transparent; border-top-color: #666;
}
.engrave-dd-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 40;
  background: #fff; border: 1px solid #ced4da; border-radius: .25rem;
  box-shadow: 0 8px 20px rgba(0,0,0,.15); max-height: 260px; overflow-y: auto;
}
.engrave-dd-opt { padding: .55rem .75rem; cursor: pointer; min-height: 52px; display: flex; align-items: center; font-size: 1.45rem; }
.engrave-dd-opt:hover { background: #f0f7ff; }
.engrave-dd-opt.selected { background: #e7f3fe; }

/* §10.278 - reserve height for the pop-in status lines so adding an icon / hitting a fit limit
   doesn't reflow the layout and jump the page under the finger on mobile. */
.engrave-fit, .engrave-icon-msg { min-height: 1.2em; }
