/* =============================================================
   Jumper Configurator — strona /konfigurator/
   Styl dopasowany do motywu Woodmart (zmienne CSS motywu)
   ============================================================= */

/* --- Ukrywanie elementów motywu Woodmart na stronie konfiguratora --- */
.jumper-configurator-page .woocommerce-breadcrumb,
.jumper-configurator-page .wd-block-header-adv,
.jumper-configurator-page .woodmart-sidebar-container,
.jumper-configurator-page .wd-sidebar-opener,

/* Tytuł strony / "Blog" / nagłówek Woodmart */
.jumper-configurator-page .woodmart-title-section,
.jumper-configurator-page .wd-page-title,
.jumper-configurator-page .page-title-section,
.jumper-configurator-page .page-header,
.jumper-configurator-page .woodmart-page-title,
.jumper-configurator-page .entry-title,
.jumper-configurator-page .wd-title,
.jumper-configurator-page h1.page-title,
.jumper-configurator-page h2.page-title,
.jumper-configurator-page .page-title,
.jumper-configurator-page .wd-breadcrumbs,
.jumper-configurator-page .woodmart-breadcrumbs,

/* Woodmart content wrapper – robimy je transparentne/full-width */
.jumper-configurator-page .wd-content-placeholder {
  display: none !important;
}

/* Rozszerzamy kontener treści Woodmart na całą szerokość */
.jumper-configurator-page #page,
.jumper-configurator-page .site,
.jumper-configurator-page #content,
.jumper-configurator-page .site-content,
.jumper-configurator-page .wd-content-area,
.jumper-configurator-page .woodmart-content-holder,
.jumper-configurator-page main.main-page-wrapper,
.jumper-configurator-page .content-area {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  float: none !important;
}

/* --- Pominięcie ekranu wyboru modelu (bez błysku) ---
   Klasa dodawana przez inline <script> PRZED wyrenderowaniem divów,
   gdy sessionStorage lub ?load_design wskazuje, że model już jest znany. */
.jcfg-skip-selector #jcfg-model-selector { display: none !important; }
.jcfg-skip-selector #jcfg-configurator  { display: block !important; }

/* --- Główny kontener — wyłamuje się z kontenera motywu --- */
.jcfg-wrap {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  /* Dodatkowy margines górny — zapobiega nakładaniu się na navbar */
  margin-top: 64px;
  background: #000000;
}

.jcfg-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.jcfg-container--full {
  max-width: 100%;
  padding: 0 20px;
}

/* =============================================================
   KROK 0: Wybór modelu
   ============================================================= */

.jcfg-model-selector {
  padding: 48px 0 64px;
}

h1.jcfg-title {
  font-family: var(--wd-title-font, inherit);
  font-size: 36px;
  /* Anton has no bold variant — theme uses 400 */
  font-weight: 400;
  text-transform: var(--wd-title-transform, capitalize);
  color: #ffffff;
  margin-bottom: 8px;
  text-align: center;
}

.jcfg-subtitle {
  font-family: var(--wd-text-font, inherit);
  color: rgba(255,255,255,0.65);
  text-align: center;
  margin-bottom: 40px;
  /* --wd-text-font-size: 18px */
  font-size: 18px;
}

/* Siatka modeli */
.jcfg-model-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
}

@media (max-width: 1100px) {
  .jcfg-model-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 700px) {
  .jcfg-model-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .jcfg-model-grid {
    grid-template-columns: 1fr;
  }
}

/* Karta modelu */
.jcfg-model-card {
  border: 1px solid #2e2e2e;
  border-radius: var(--wd-brd-radius, 2px);
  background: #1a1a1a;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
}

.jcfg-model-card:hover {
  border-color: rgb(198,253,1);
  box-shadow: 0 4px 20px rgba(198,253,1,0.15);
  transform: translateY(-2px);
}

.jcfg-model-card__image {
  background: #111111;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  overflow: hidden;
}

.jcfg-model-card__image img.jcfg-model-thumb {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.jcfg-model-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
}

.jcfg-model-card__info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

h3.jcfg-model-card__name {
  font-family: var(--wd-title-font, inherit);
  /* Shop product titles: Anton 400, 24px (archive). Card is smaller context → 18px */
  font-size: 18px;
  font-weight: 400;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0 0 8px;
}

.jcfg-model-card__price {
  font-family: var(--wd-text-font, inherit);
  font-size: 16px;
  color: rgba(255,255,255,0.6);
  margin: 0 0 12px;
  flex: 1;
}

.jcfg-model-card__price strong {
  /* Real theme lime: rgb(198,253,1) */
  color: rgb(198,253,1);
  font-size: 18px;
  font-weight: 700;
}

/* =============================================================
   PRZYCISK — globalny styl dopasowany do Woodmart
   ============================================================= */

.jcfg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--wd-text-font, inherit);
  /* --btn-default-font-weight: 400 in theme */
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  padding: 0 20px;
  height: var(--wd-form-height, 42px);
  border: 2px solid transparent;
  border-radius: var(--wd-brd-radius, 2px);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
}

.jcfg-btn--primary {
  background-color: var(--wd-primary-color, rgb(198,253,1)) !important;
  /* Dark text on lime — matches theme --btn-default-color */
  color: #333 !important;
  border-color: var(--wd-primary-color, rgb(198,253,1)) !important;
}

.jcfg-btn--primary:hover,
.jcfg-btn--primary:focus {
  background-color: rgba(198,253,1,0.85);
  border-color: rgba(198,253,1,0.85);
  color: #333;
}

/* Przycisk primary w stanie disabled — lime z obnizoną opacją */
.jcfg-btn--primary[disabled] {
  background-color: var(--wd-primary-color, rgb(198,253,1));
  border-color: var(--wd-primary-color, rgb(198,253,1));
  color: #333;
  opacity: 1;
  pointer-events: none;
  box-shadow: none;
}

/* Przyciski aktywne — sałatowy z czarnym tekstem (Dodaj tekst + Potwierdź zamówienie) */
#jcfg-add-text-btn:not([disabled]),
#jcfg-confirm-order:not([disabled]) {
  background-color: #b8e04a;
  border-color: #a3cc35;
  color: #1a1a1a;
  box-shadow: 0 0 0 3px rgba(184, 224, 74, 0.4);
  animation: jcfg-btn-ready 0.3s ease;
}

#jcfg-add-text-btn:not([disabled]):hover,
#jcfg-confirm-order:not([disabled]):hover {
  background-color: #a3cc35;
  border-color: #8fb82a;
  color: #1a1a1a;
}

@keyframes jcfg-btn-ready {
  0%   { transform: scale(0.97); box-shadow: 0 0 0 0 rgba(184, 224, 74, 0.6); }
  60%  { transform: scale(1.02); box-shadow: 0 0 0 6px rgba(184, 224, 74, 0.25); }
  100% { transform: scale(1);    box-shadow: 0 0 0 3px rgba(184, 224, 74, 0.4); }
}

.jcfg-btn--ghost {
  background-color: transparent;
  color: rgba(255,255,255,0.75);
  border-color: #444;
}

.jcfg-btn--ghost:hover {
  border-color: rgb(198,253,1);
  color: rgb(198,253,1);
}

.jcfg-btn--lg {
  height: 50px;
  padding: 0 32px;
  font-size: 15px;
}

.jcfg-btn--full {
  width: 100%;
}

.jcfg-btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

/* =============================================================
   KONFIGURATOR — TOPBAR
   ============================================================= */

.jcfg-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #2e2e2e;
  margin-bottom: 0;
}

.jcfg-model-name {
  font-family: var(--wd-title-font, inherit);
  /* Anton — no bold variant, theme uses 400 */
  font-weight: 400;
  text-transform: uppercase;
  color: #ffffff;
  font-size: 16px;
}

/* =============================================================
   ZAKŁADKI STRON ODZIEŻY
   ============================================================= */

.jcfg-side-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #2e2e2e;
  margin-bottom: 0;
}

.jcfg-side-tab {
  font-family: var(--wd-text-font, inherit);
  /* Matches nav link size (16px) and weight (500) */
  font-size: 16px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 12px 20px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.jcfg-side-tab:hover:not(.jcfg-side-tab--active):not([aria-selected="true"]) {
  color: rgba(255,255,255,0.9);
  background: #1a1a1a;
}

/* Aktywna zakładka — limonkowy kolor tekstu z podkreśleniem */
.jcfg-side-tab--active,
.jcfg-side-tab[aria-selected="true"] {
  color: rgb(198,253,1) !important;
  background: #111111 !important;
  border-bottom-color: rgb(198,253,1);
  font-weight: 600;
}

/* =============================================================
   OBSZAR ROBOCZY: Canvas 2D + 3D
   ============================================================= */

.jcfg-workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  /* Wysokość workspace ≤ 70vh — nie zajmuje całego ekranu */
  height: clamp(420px, 65vh, 640px);
  border: 1px solid #2e2e2e;
  border-top: none;
}

@media (max-width: 900px) {
  .jcfg-workspace {
    grid-template-columns: 1fr;
    height: auto;
  }
}

/* Lewa kolumna — Fabric.js canvas */
.jcfg-canvas-col {
  background: #141414;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12px;
  border-right: 1px solid #2e2e2e;
  position: relative;
  overflow: hidden; /* Bez scrollowania — canvas skalowany przez JS */
}

.jcfg-canvas-wrap {
  position: relative;
  display: inline-block;
  /* Stały rozmiar = rozmiar jednego canvas — żeby wrap nie zmieniał wysokości */
  width: 500px;
  height: 600px;
  line-height: 0;
  flex-shrink: 0;
  transform-origin: top center;
  /* Skala ustawiana przez JS przez CSS custom property */
  transform: scale(var(--jcfg-canvas-scale, 1));
}

/* Warstwa koloru odzieży — maskowana SVG kształtem wydruku (za canvasem) */
#jcfg-color-fill-div {
  position: absolute;
  top: 0;
  left: 0;
  width: 500px;
  height: 600px;
  z-index: 1;
  pointer-events: none;
  transform-origin: top left;
}

/* Wszystkie canvas-container Fabric.js nakładają się w tym samym miejscu */
.jcfg-canvas-wrap .canvas-container {
  position: absolute !important;
  top: 0;
  left: 0;
  z-index: 2;
}

.jcfg-canvas-wrap canvas {
  display: block;
}

/* Kontur wykrojnika — przewodnik wizualny do pozycjonowania na 2D canvas.
   Nie jest elementem Fabric.js więc canvas.toDataURL() go nie uwzględnia. */
.jcfg-wykrojnik-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;        /* canvas AR = wykrojnik AR → brak zniekształceń */
  mix-blend-mode: multiply; /* białe obszary stają się przezroczyste, czarne linie widoczne */
  z-index: 1;              /* nad color-fill-div, pod canvas-container (z-index: 2) */
  pointer-events: none;    /* kliknięcia trafiają do Fabric.js */
  opacity: 0.4;
}


/* === Overlay pól bezpieczeństwa (wózek) === */
/* Strefa bezpieczeństwa — pozycja i rozmiar ustawiane przez JS (applySafeZoneOverlay) */
.jcfg-safety-overlay {
  position: absolute;
  pointer-events: none;
  z-index: 50;
  box-sizing: border-box;
  border-top:    var(--sz-top,    50px) solid rgba(180, 60, 60, 0.20);
  border-bottom: var(--sz-bottom, 50px) solid rgba(180, 60, 60, 0.20);
  border-left:   var(--sz-left,   50px) solid rgba(180, 60, 60, 0.20);
  border-right:  var(--sz-right,  50px) solid rgba(180, 60, 60, 0.20);
}

/* Linia graniczna strefy bezpiecznej */
.jcfg-safety-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px dashed rgba(220, 50, 50, 0.65);
}


/* Prawa kolumna — Three.js 3D */
.jcfg-3d-col {
  background: #2d2d2d;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
  overflow: hidden;
}

.jcfg-3d-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.jcfg-3d-wrap canvas#jcfg-3d-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.jcfg-3d-hint {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

.jcfg-3d-wrap .jcfg-screenshot-btn {
  position: absolute !important;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  z-index: 15;
  padding: 0;
  margin: 0;
  line-height: 1;
  box-shadow: none;
}
.jcfg-3d-wrap .jcfg-screenshot-btn:hover {
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
}

.jcfg-3d-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(45, 45, 45, 0.75);
  z-index: 20;
}

.jcfg-3d-loader__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgb(198, 253, 1);
  border-radius: 50%;
  animation: jcfg-spin 0.8s linear infinite;
}

.jcfg-page-loader {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.93);
  border-radius: inherit;
}

.jcfg-page-loader__spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e0e0e0;
  border-top-color: var(--wd-primary-color, #83b735);
  border-radius: 50%;
  animation: jcfg-spin 0.8s linear infinite;
}

.jcfg-page-loader__text {
  color: #555;
  font-size: 14px;
  margin: 0;
}

/* =============================================================
   PASEK NARZĘDZI
   ============================================================= */

.jcfg-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #111111;
  border: 1px solid #2e2e2e;
  border-top: none;
  flex-wrap: wrap;
}

.jcfg-toolbar__tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.jcfg-tool-btn {
  font-family: var(--wd-text-font, inherit);
  font-size: 13px;
  font-weight: 600;
  background: #1e1e1e;
  border: 1px solid #3a3a3a;
  border-radius: var(--wd-brd-radius, 2px);
  height: 36px;
  padding: 0 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255,255,255,0.8);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}

.jcfg-tool-btn:hover:not([disabled]) {
  border-color: rgb(198,253,1);
  color: rgb(198,253,1);
}

/* Przycisk niebezpieczny (Usuń ✕) — domyślnie pomarańczowy obramowanie */
.jcfg-tool-btn--danger {
  color: #e65100;
  border-color: #e65100;
}

.jcfg-tool-btn--danger:hover:not([disabled]) {
  background: #e65100;
  border-color: #e65100;
  color: #fff;
}

/* Przycisk Reset — szary z czerwonym hover */
.jcfg-tool-btn--reset {
  color: #555;
  border-color: #aaa;
}

.jcfg-tool-btn--reset:hover:not([disabled]) {
  background: #d32f2f;
  border-color: #d32f2f;
  color: #fff;
}

.jcfg-tool-btn[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

/* Stan aktywny — panel otwarty */
.jcfg-tool-btn--active {
  border-color: rgb(198,253,1);
  color: rgb(198,253,1);
  background: rgba(198,253,1,0.1);
}

/* Focus outline dla nawigacji klawiaturą */
.jcfg-tool-btn:focus-visible,
.jcfg-side-tab:focus-visible,
.jcfg-btn:focus-visible,
.jcfg-size-btn:focus-visible {
  outline: 2px solid var(--wd-primary-color, #83b735);
  outline-offset: 2px;
}

/* Kółko podglądu koloru przy przycisku Kolor */
.jcfg-color-preview {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #555;
  flex-shrink: 0;
}

/* =============================================================
   PANELE NARZĘDZI
   ============================================================= */

/* =============================================================
   PANELE — izolowane od dark theme Woodmart
   Wszystkie kolory hardcoded (nie CSS vars motywu)
   ============================================================= */

.jcfg-panel {
  position: fixed;
  z-index: 99998;
  background: #ffffff;
  color: #222222; /* explicit — nie dziedziczymy z dark theme */
  border: 1px solid #d8d8d8;
  border-radius: 2px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  width: 300px;
  max-width: calc(100vw - 32px);
  /* Wymuś light color scheme */
  color-scheme: light;
}

/* Elementy tekstowe w panelu — jawne ciemne kolory (bez wildcarda, by nie nadpisać przycisków) */
.jcfg-panel input:not([type="color"]):not([type="checkbox"]):not([type="radio"]),
.jcfg-panel select,
.jcfg-panel textarea {
  color: #222222 !important;
  -webkit-text-fill-color: #222222 !important;
}

/* Przyciski w panelu — zachowaj ich własne kolory */
.jcfg-panel .jcfg-btn--primary {
  color: #333 !important;
  -webkit-text-fill-color: #333 !important;
}
.jcfg-panel .jcfg-btn--primary:hover,
.jcfg-panel .jcfg-btn--primary:focus {
  color: #333 !important;
  -webkit-text-fill-color: #333 !important;
}

.jcfg-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e0e0e0;
}

.jcfg-panel__header h3 {
  font-size: 14px;
  font-weight: 500;
  margin: 0;
  color: #555 !important;
  -webkit-text-fill-color: #555 !important;
}

.jcfg-panel__close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #666 !important;
  -webkit-text-fill-color: #666 !important;
  padding: 0 4px;
  transition: color 0.15s;
}

.jcfg-panel__close:hover {
  color: #1a1a1a !important;
  -webkit-text-fill-color: #1a1a1a !important;
}

.jcfg-panel__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Panel kolorów */
.jcfg-color-wheel-wrap {
  display: flex;
  justify-content: center;
}

.jcfg-color-wheel-wrap input[type="color"] {
  width: 64px;
  height: 64px;
  border: 2px solid #d0d0d0;
  background: #fff;
  cursor: pointer;
  padding: 2px;
  border-radius: 50%;
}

.jcfg-color-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.jcfg-color-inputs--compact {
  margin-top: 8px;
}

.jcfg-input-label {
  font-size: 11px;
  font-weight: 700;
  color: #666 !important;
  -webkit-text-fill-color: #666 !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 6px;
}

.jcfg-color-group {
  display: flex;
  flex-direction: column;
}

.jcfg-color-row {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap; /* C M Y K muszą być w jednej linii */
}

.jcfg-color-row label {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #555 !important;
  -webkit-text-fill-color: #555 !important;
  gap: 3px;
}

.jcfg-color-num {
  width: 44px;
  height: 32px;
  border: 1px solid #bbb;
  border-radius: 2px;
  text-align: center;
  font-size: 13px;
  padding: 0 4px;
  color: #222 !important;
  -webkit-text-fill-color: #222 !important;
  background: #f8f8f8 !important;
}

/* Panel tekstu */
.jcfg-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.jcfg-field label {
  font-size: 13px;
  font-weight: 600;
  color: #333 !important;
  -webkit-text-fill-color: #333 !important;
}
.jcfg-modal__box .jcfg-field label {
  color: rgba(255,255,255,0.7) !important;
  -webkit-text-fill-color: rgba(255,255,255,0.7) !important;
}

.jcfg-field textarea,
.jcfg-field select,
.jcfg-field input[type="number"],
.jcfg-field input[type="text"] {
  font-size: 14px;
  height: 42px;
  border: 1px solid #bbb;
  border-radius: 2px;
  padding: 0 10px;
  color: #222 !important;
  -webkit-text-fill-color: #222 !important;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}


.jcfg-field select {
  appearance: auto;
}

.jcfg-field select option {
  background: #ffffff !important;
  color: #222222 !important;
}

/* Font preview — każda opcja renderowana własną czcionką */
#jcfg-text-font option[value="Roboto"]           { font-family: 'Roboto', sans-serif; }
#jcfg-text-font option[value="Oswald"]           { font-family: 'Oswald', sans-serif; }
#jcfg-text-font option[value="Montserrat"]       { font-family: 'Montserrat', sans-serif; }
#jcfg-text-font option[value="Bebas Neue"]       { font-family: 'Bebas Neue', sans-serif; }
#jcfg-text-font option[value="Playfair Display"] { font-family: 'Playfair Display', serif; }
#jcfg-text-font option[value="Anton"]            { font-family: 'Anton', sans-serif; }

/* Licznik znaków pod polem tekstu */
.jcfg-char-count {
  display: block;
  font-size: 11px;
  color: #888;
  text-align: right;
  margin-top: 2px;
}

.jcfg-text-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.jcfg-text-color-row input[type="color"] {
  width: 36px;
  height: 36px;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.jcfg-text-color-preview {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #ccc;
  background: #000;
  display: inline-block;
}

/* Panel kopiowania */
.jcfg-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #333 !important;
  -webkit-text-fill-color: #333 !important;
  cursor: pointer;
  padding: 4px 0;
}

/* =============================================================
   MODAL: Wybór rozmiaru
   ============================================================= */

.jcfg-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.jcfg-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.jcfg-modal__box {
  position: relative;
  z-index: 1;
  background: #111;
  color: #f0f0f0;
  color-scheme: dark;
  border-radius: var(--wd-brd-radius, 2px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  padding: 32px;
  width: 440px;
  max-width: calc(100vw - 32px);
  max-height: 90vh;
  overflow-y: auto;
}

.jcfg-modal__box h3 {
  font-family: var(--wd-widget-title-font, var(--wd-title-font, inherit));
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 24px;
}

/* Rozmiar — select dropdown */
.jcfg-size-select-wrap {
  margin-bottom: 20px;
}

.jcfg-size-select {
  width: 100%;
  height: 48px;
  padding: 0 40px 0 14px;
  font-family: var(--wd-text-font, inherit);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background-color: #1e1e1e;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23aaa' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  border: 2px solid #444;
  border-radius: var(--wd-brd-radius, 2px);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.jcfg-size-select:hover {
  border-color: var(--wd-primary-color, #83b735);
}

.jcfg-size-select:focus {
  border-color: var(--wd-primary-color, #83b735);
  box-shadow: 0 0 0 3px rgba(198, 253, 1, 0.2);
}

.jcfg-size-select option {
  background-color: #1e1e1e;
  color: #fff;
}
.jcfg-size-select option:checked {
  background-color: rgb(198,253,1);
  color: #111;
}

/* Ilość */
.jcfg-qty-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.jcfg-qty-row label {
  font-family: var(--wd-text-font, inherit);
  font-size: 14px;
  font-weight: 600;
  /* Hardcoded — inside white modal */
  color: #444;
  white-space: nowrap;
}

.jcfg-qty-controls {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid #444;
  border-radius: var(--wd-brd-radius, 2px);
  overflow: hidden;
}

.jcfg-qty-btn {
  width: 36px;
  height: 36px;
  background: #1e1e1e;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #ddd;
  transition: background 0.15s;
  line-height: 1;
}

.jcfg-qty-btn:hover {
  background: var(--wd-primary-color, rgb(198,253,1));
  color: #111;
}

#jcfg-qty {
  width: 56px;
  height: 36px;
  border: none;
  border-left: 1px solid #444;
  border-right: 1px solid #444;
  text-align: center;
  font-size: 15px;
  font-family: var(--wd-text-font, inherit);
  background: #1e1e1e;
  color: #fff;
}

/* Podgląd projektu w modalu — ukryty */
.jcfg-modal__preview {
  display: none;
}

.jcfg-modal__preview img {
  max-width: 120px;
  height: auto;
  border: 1px solid var(--color-gray-200, #e8e8e8);
}


.jcfg-modal__actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-top: 20px;
}

.jcfg-modal__actions .jcfg-btn,
.jcfg-modal__actions .button {
  flex: 1;
  text-align: center;
}

/* Modal zapisu projektu — węższy box, bez podglądu */
.jcfg-save-modal__box {
  max-width: 400px;
}

/* Status zamówienia */
.jcfg-order-status {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--wd-brd-radius, 2px);
  font-size: 14px;
  font-family: var(--wd-text-font, inherit);
  background: #f0f8e8;
  color: #4a7c10;
  border: 1px solid #c6e29a;
  text-align: center;
}

.jcfg-order-status--error {
  background: #fdecea;
  color: #c62828;
  border-color: #f5c6c6;
}

/* =============================================================
   STANY ŁADOWANIA
   ============================================================= */

.jcfg-loading {
  opacity: 0.6;
  pointer-events: none;
}

.jcfg-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: jcfg-spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes jcfg-spin {
  to {
    transform: rotate(360deg);
  }
}

/* =============================================================
   RESPONSYWNOŚĆ KONFIGURATORA
   ============================================================= */

@media (max-width: 900px) {
  .jcfg-canvas-col {
    border-right: none;
    border-bottom: 1px solid #2e2e2e;
    height: 400px; /* Jawna wysokość — grid nie może rosnąć do 600px canvas, fitCanvasToContainer() działa */
    min-height: unset;
  }
  .jcfg-3d-col {
    height: 320px;
    min-height: unset;
  }
}

@media (max-width: 600px) {
  .jcfg-toolbar {
    padding: 10px;
    gap: 8px;
  }
  .jcfg-tool-btn {
    height: 32px;
    padding: 0 8px;
    font-size: 12px;
  }
  .jcfg-side-tab {
    padding: 10px 12px;
    font-size: 13px;
  }
  .jcfg-modal__box {
    padding: 20px;
  }
}

/* =============================================================
   UKRYWANIE ELEMENTÓW BLOKOWYCH WORDPRESS / GUTENBERG
   (nie powinny pojawiać się na stronie konfiguratora)
   ============================================================= */

.jumper-configurator-page .wp-block,
.jumper-configurator-page .wp-block-*,
.jumper-configurator-page .block-editor,
.jumper-configurator-page .block-editor-*,
.jumper-configurator-page .editor-styles-wrapper,
.jumper-configurator-page .wp-block-cover,
.jumper-configurator-page .wp-block-group,
.jumper-configurator-page .wp-block-columns,
.jumper-configurator-page .wp-block-paragraph,
.jumper-configurator-page .wp-block-heading,
.jumper-configurator-page .wp-block-button,
.jumper-configurator-page .wp-block-image,
.jumper-configurator-page .wp-block-spacer,
.jumper-configurator-page .wc-block-*,
.jumper-configurator-page [class^="wp-block-"],
.jumper-configurator-page [class*=" wp-block-"],
.jumper-configurator-page [class^="wc-block-"],
.jumper-configurator-page [class*=" wc-block-"],
.jumper-configurator-page .woocommerce-notices-wrapper:empty {
  display: none !important;
}

/* ============================================================
   POWIADOMIENIE O JAKOSCI ZDJECIA (photo low-res notice)
   ============================================================ */

.jcfg-photo-notice {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff3cd;
  color: #664d03;
  border: 1px solid #ffda6a;
  border-radius: 6px;
  padding: 12px 20px;
  font-size: 14px;
  max-width: 420px;
  width: calc(100% - 40px);
  text-align: center;
  z-index: 99999;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  transition: opacity 0.7s ease;
  opacity: 1;
}

.jcfg-photo-notice--hide {
  opacity: 0;
}

.jcfg-photo-notice--error {
  background: #f8d7da;
  color: #842029;
  border-color: #f5c2c7;
}

/* ============================================================
   PLISA POD SZYJĘ — przycisk i panel
   ============================================================ */
.jcfg-plisa-wrap {
  display: inline-flex;
  align-items: center;
}

/* ============================================================
   LAMÓWKA TOGGLE
   ============================================================ */
.jcfg-lamowka-wrap {
  position: relative;
  display: inline-flex;
}

/* Popup dropdown */
.jcfg-lamowka-popup {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #252525;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  padding: 6px;
  gap: 4px;
  flex-direction: column;
  z-index: 200;
  min-width: 120px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.jcfg-lamowka-wrap.is-open .jcfg-lamowka-popup {
  display: flex;
}

/* Options inside popup */
.jcfg-lamowka-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
  width: 100%;
}
.jcfg-lamowka-btn:hover {
  background: rgba(255,255,255,0.07);
}
.jcfg-lamowka-btn--active {
  border-color: rgb(198,253,1);
  background: rgba(198,253,1,0.06);
}

.jcfg-lamowka-chip {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.2);
}

/* Strefa bezpieczeństwa — pozycja/wymiary ustawiane przez JS; tu tylko override z-index */
.jcfg-safety-overlay {
  z-index: 50;
}

/* ============================================================
   KLUB: baner trybu klubowego (widoczny gdy cfg.clubSlug)
   ============================================================ */
#jcfg-club-banner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: rgba(30, 120, 60, 0.1);
	border: 1px solid rgba(30, 120, 60, 0.25);
	border-radius: 4px;
	padding: 8px 16px;
	font-size: 13px;
	margin: 0 auto 12px;
	max-width: 1400px;
	box-sizing: border-box;
}
#jcfg-club-panel-link {
	white-space: nowrap;
	text-decoration: underline;
	font-size: 12px;
	opacity: 0.75;
	color: inherit;
}
