/* Auto-Impex Konfigurátor overlay */
html.ai-konf-open, html.ai-konf-open body { overflow: hidden !important; }
.ai-konf {
  position: fixed; inset: 0; z-index: 2147483000;
  background: #fbfbfc;
  display: flex; align-items: center; justify-content: center;
}
.ai-konf[hidden] { display: none; }
.ai-konf__frame {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; background: transparent; opacity: 0;
  transition: opacity .2s ease;
}
.ai-konf.is-ready .ai-konf__frame { opacity: 1; }
.ai-konf.is-ready .ai-konf__loading { display: none; }
.ai-konf__loading {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  color: #424246; font: 500 15px/1.4 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  text-align: center; padding: 24px;
}
.ai-konf__loading a { color: #DC2626; }
.ai-konf__spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid #e5e5ea; border-top-color: #DC2626;
  animation: ai-konf-spin .8s linear infinite;
}
@keyframes ai-konf-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ai-konf__spinner { animation-duration: 2.4s; } .ai-konf__frame { transition: none; } }
.ai-konf__close {
  position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid #d2d2d7; background: #fff; color: #1d1d1f;
  font-size: 18px; line-height: 1; cursor: pointer;
}
.ai-konf__close[hidden] { display: none; }
.ai-konf__close:focus-visible { outline: 2px solid #DC2626; outline-offset: 2px; }
/* Button next to "Mám záujem o vozidlo" in the page header */
.ai-konf-open--auto { margin-left: 12px; vertical-align: middle; white-space: nowrap; }
/* The theme styles every <span> in the price bar under the gallery as the big price
   (Teko 32px, margin-right 30px). Our label is a span too, so give it the button's type back.
   Colour stays with the theme (.dark on light backgrounds). */
a.ai-konf-open > span {
  font-size: inherit !important;
  font-family: inherit !important;
  font-weight: inherit !important;
  letter-spacing: inherit !important;
  line-height: inherit !important;
  margin: 0 !important;
  white-space: nowrap;
}
.new-detail__tabs-hd .price a.ai-konf-open { margin: 0 0 0 12px; }
@media (max-width: 600px) { .ai-konf-open--auto { margin-left: 0; margin-top: 10px; } }
/* Price bar under the gallery: keep the price on the left and both buttons together on the right
   (the theme spreads the items apart with space-between on narrower screens). */
.new-detail__tabs-hd .price.ai-konf-has-btn { justify-content: flex-end; }
.new-detail__tabs-hd .price.ai-konf-has-btn > span:first-child { margin-right: auto; }
@media (max-width: 550px) {
  /* Theme stacks price and button; ours goes under the red one at the same width. */
  .new-detail__tabs-hd .price.ai-konf-has-btn { justify-content: flex-start; align-items: center; }
  .new-detail__tabs-hd .price.ai-konf-has-btn > span:first-child { margin-right: 0; }
  .new-detail__tabs-hd .price a.ai-konf-open { margin: 12px 0 0; justify-content: center; }
  /* Header: theme puts the red button full width in second place; ours follows it. */
  .new-detail__head-boxin .button__cd a.ai-konf-open { order: 3; width: calc(100% - 24px); margin: 0 12px 12px; justify-content: center; }
}

/* ---------- Configurator page /konfigurator/<slug>/ ---------- */
.ai-konf-page { background: #f1f3f6; }
.ai-konf-page__bar { background: #10151c; color: #fff; }
.ai-konf-page__bar-in {
  max-width: 1400px; margin: 0 auto; padding: 22px 24px 18px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.ai-konf-page__crumbs { font: 500 13px/1.4 'DM Sans', sans-serif; color: #aeb4bd; display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ai-konf-page__crumbs a { color: #c9ced6; text-decoration: none; }
.ai-konf-page__crumbs a:hover { color: #fff; }
.ai-konf-page__h1 {
  font-family: Teko, sans-serif; font-weight: 500; text-transform: uppercase;
  font-size: 44px; line-height: 1; letter-spacing: .5px; margin: 0; color: #fff;
}
.ai-konf-page__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ai-konf-page__actions a.button__bordered,
.ai-konf-page__actions a.button__red { margin: 0; }
.ai-konf-page__frame-wrap { position: relative; height: calc(100vh - 80px); min-height: 520px; background: #f1f3f6; }
.ai-konf-page__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; transition: opacity .2s ease; }
.ai-konf-page__frame-wrap.is-ready .ai-konf-page__frame { opacity: 1; }
.ai-konf-page__frame-wrap.is-ready .ai-konf-page__loading { display: none; }
.ai-konf-page__loading {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  color: #424246; font: 500 15px/1.4 'DM Sans', system-ui, sans-serif; text-align: center; padding: 24px;
}
.ai-konf-page__loading a { color: #de262d; }
@media (max-width: 767px) {
  .ai-konf-page__bar-in { padding: 12px 16px 14px; align-items: stretch; gap: 12px; }
  .ai-konf-page__crumbs { font-size: 12px; margin-bottom: 2px; }
  .ai-konf-page__h1 { font-size: 28px; }
  .ai-konf-page__actions { width: 100%; display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
  .ai-konf-page__actions a.button__bordered,
  .ai-konf-page__actions a.button__red {
    display: flex !important; align-items: center; justify-content: center; text-align: center;
    min-height: 46px; padding: 8px 10px !important; margin: 0 !important; width: auto !important;
    font-size: 14px !important; line-height: 1.1 !important; letter-spacing: 1px !important; white-space: nowrap;
  }
  .ai-konf-page__actions a > span { font-size: inherit !important; margin: 0 !important; }
}
@media (max-width: 360px) {
  .ai-konf-page__actions a.button__bordered, .ai-konf-page__actions a.button__red { font-size: 12.5px !important; letter-spacing: .5px !important; }
}
