/* --- Podstawowe Style --- */
.blaty-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 40px;
  max-width: 1300px;
  margin: 0 auto;
  font-family: 'Segoe UI', sans-serif;
  padding: 20px;
  font-size: 15px;
}

/* ZMIANA: .blaty-left z dodanym flexem */
.blaty-left {
  width: 100%; 
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important; 
}

/* NOWOŚĆ: Pływający lewy panel tylko na większych ekranach (od 900px szerokości) */
@media (min-width: 900px) {
  .blaty-left {
    position: sticky !important;
    top: 40px; /* Odległość od górnej krawędzi ekranu przy scrollowaniu */
    align-self: start; /* ZAPOBIEGA rozciąganiu się kolumny do wysokości formularza, co jest kluczowe dla sticky */
    max-height: calc(100vh - 60px); /* Zabezpieczenie: jeśli ktoś ma bardzo niski monitor, panel zyska własny delikatny scroll */
    overflow-y: auto;
  }
  
  /* Ładniejszy, cienki pasek scrolla dla lewego panelu (jeśli ekran jest bardzo niski) */
  .blaty-left::-webkit-scrollbar {
    width: 6px;
  }
  .blaty-left::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
  }
}

.blaty-right {
  width: 100%;
}.blaty-right {
  width: 100%;
}

.blaty-box {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(0,0,0,0.05);
  padding: 20px;
  width: 100%;
  max-width: 600px; /* Nadal ograniczamy max szerokość */
  margin-bottom: 24px;
  box-sizing: border-box;
  /* margin: auto nie jest potrzebne, bo flex centruje */
}

#decor-preview-image {
  width: 100%;
  max-width: 350px;
  height: auto;
  max-height: 250px;
  object-fit: contain;
  display: block;
  margin: 10px auto; /* Centruje wewnątrz boxa */
  border-radius: 6px;
}


/* --- Style Formularza (bez zmian) --- */
.blaty-form input[type="text"],
.blaty-form input[type="email"],
.blaty-form input[type="tel"],
.blaty-form input[type="number"],
.blaty-form select,
.blaty-form textarea {
  width: 100%;
  padding: 8px 10px;
  margin-top: 6px;
  margin-bottom: 12px;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-size: 15px;
  box-sizing: border-box;
}
.blaty-form label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 8px;
}
.blaty-form label.checkbox-label {
    flex-direction: row;
    align-items: center;
}
.blaty-form button {
  background: #0073aa;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  width: 100%;
}
.blaty-form button:hover {
  background: #005f8d;
}
.blaty-form button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* --- Podgląd Ceny (bez zmian) --- */
.blaty-preview {
  font-size: 15px;
  margin-top: 20px;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 5px;
  line-height: 1.6;
}

/* --- Rysunek Techniczny (SVG) --- */
.blaty-svg-title {
  display: block;
  font-size: 1.1em;
  font-weight: bold;
  text-align: center;
  width: 100%;
  max-width: 600px;
  margin: 20px 0 15px 0;
  box-sizing: border-box;
}
.svg-container {
  width: 100%;
  max-width: 600px;
  padding: 10px 0;
  box-sizing: border-box;
}
#tech-svg {
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  display: block;
}

/* --- Przycisku i Modal (Pop-up) (bez zmian) --- */
.blaty-modal-open-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px;
  font-size: 16px;
  text-align: left;
  background: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.blaty-modal-open-btn:hover {
  background: #f1f1f1;
}
#selected-decor-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 15px;
  border: 1px solid #ddd;
}
.blaty-modal-overlay {
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}
.blaty-modal-content {
  background-color: #fefefe;
  margin: auto;
  border-radius: 8px;
  width: 100%;
  max-width: 900px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  animation: modal-fade-in 0.3s;
  display: flex;
  flex-direction: column;
}
.blaty-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  border-bottom: 1px solid #e5e5e5;
}
.blaty-modal-header h3 {
  margin: 0;
  font-size: 20px;
}
.blaty-modal-close {
  font-size: 32px;
  font-weight: bold;
  color: #aaa;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 5px;
  line-height: 1;
}
.blaty-modal-close:hover {
  color: #333;
}
.blaty-modal-body {
  padding: 25px;
  max-height: 70vh;
  overflow-y: auto;
}
@keyframes modal-fade-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* --- Siatka wzorów (bez zmian) --- */
.decor-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 20px;
  margin-top: 10px;
}
.decor-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  border: 2px solid #eee;
  border-radius: 8px;
  padding: 10px;
  transition: all 0.2s ease;
}
.decor-option:hover {
  border-color: #0073aa;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}
.decor-option img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 8px;
}
.decor-option span {
  font-size: 13px;
  text-align: center;
  font-weight: 500;
}
.decor-option input[type="radio"] {
  display: none;
}
.decor-option input[type="radio"]:checked + img + span {
  font-weight: bold;
  color: #0073aa;
}
.decor-option.selected {
    border-color: #0073aa;
    background-color: #f4faff;
    box-shadow: 0 0 10px rgba(0, 115, 170, 0.7);
}
/* Styl dla dodatkowych informacji o wzorze (bez zmian) */
.decor-preview-details-container {
  text-align: center;
  margin-top: 8px;
  font-size: 14px;
  color: #555;
  line-height: 1.4;
}
.decor-preview-details-container span {
  display: inline-block;
  margin: 0 5px;
}

/* --- Podstawowe Style --- */
.blaty-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 40px;
  max-width: 1300px;
  margin: 0 auto;
  font-family: 'Segoe UI', sans-serif;
  padding: 20px;
  font-size: 15px;
}

.blaty-left {
  width: 100%; 
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important; 
}
.blaty-right {
  width: 100%;
}

.blaty-box {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(0,0,0,0.05);
  padding: 20px;
  width: 100%;
  max-width: 600px; 
  margin-bottom: 24px;
  box-sizing: border-box;
}

#decor-preview-image {
  width: 100%;
  max-width: 350px;
  height: auto;
  max-height: 250px;
  object-fit: contain;
  display: block;
  margin: 10px auto; 
  border-radius: 6px;
}

/* --- Style Formularza --- */
.blaty-form input[type="text"],
.blaty-form input[type="email"],
.blaty-form input[type="tel"],
.blaty-form input[type="number"],
.blaty-form select,
.blaty-form textarea {
  width: 100%;
  padding: 8px 10px;
  margin-top: 6px;
  margin-bottom: 12px;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-size: 15px;
  box-sizing: border-box;
}
.blaty-form label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 8px;
}
.blaty-form label.checkbox-label {
    flex-direction: row;
    align-items: center;
}
.blaty-form button {
  background: #0073aa;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  width: 100%;
}
.blaty-form button:hover {
  background: #005f8d;
}
.blaty-form button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* --- Podgląd Ceny --- */
.blaty-preview {
  font-size: 15px;
  margin-top: 20px;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 5px;
  line-height: 1.6;
}

/* --- Rysunek Techniczny (SVG) --- */
.blaty-svg-title {
  display: block;
  font-size: 1.1em;
  font-weight: bold;
  text-align: center;
  width: 100%;
  max-width: 600px;
  margin: 20px 0 15px 0;
  box-sizing: border-box;
}
.svg-container {
  width: 100%;
  max-width: 600px;
  padding: 10px 0;
  box-sizing: border-box;
}
#tech-svg {
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  display: block;
}

/* --- Przycisku i Modal --- */
.blaty-modal-open-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px;
  font-size: 16px;
  text-align: left;
  background: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.blaty-modal-open-btn:hover {
  background: #f1f1f1;
}
#selected-decor-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 15px;
  border: 1px solid #ddd;
}
.blaty-modal-overlay {
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}
.blaty-modal-content {
  background-color: #fefefe;
  margin: auto;
  border-radius: 8px;
  width: 100%;
  max-width: 900px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  animation: modal-fade-in 0.3s;
  display: flex;
  flex-direction: column;
}
.blaty-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  border-bottom: 1px solid #e5e5e5;
}
.blaty-modal-header h3 {
  margin: 0;
  font-size: 20px;
}
.blaty-modal-close {
  font-size: 32px;
  font-weight: bold;
  color: #aaa;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 5px;
  line-height: 1;
}
.blaty-modal-close:hover {
  color: #333;
}
.blaty-modal-body {
  padding: 25px;
  max-height: 70vh;
  overflow-y: auto;
}
@keyframes modal-fade-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* --- Siatka wzorów --- */
.decor-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 20px;
  margin-top: 10px;
}
.decor-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  border: 2px solid #eee;
  border-radius: 8px;
  padding: 10px;
  transition: all 0.2s ease;
}
.decor-option:hover {
  border-color: #0073aa;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}
.decor-option img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 8px;
}
.decor-option span {
  font-size: 13px;
  text-align: center;
  font-weight: 500;
}
.decor-option input[type="radio"] {
  display: none;
}
.decor-option input[type="radio"]:checked + img + span {
  font-weight: bold;
  color: #0073aa;
}
.decor-option.selected {
    border-color: #0073aa;
    background-color: #f4faff;
    box-shadow: 0 0 10px rgba(0, 115, 170, 0.7);
}
.decor-preview-details-container {
  text-align: center;
  margin-top: 8px;
  font-size: 14px;
  color: #555;
  line-height: 1.4;
}
.decor-preview-details-container span {
  display: inline-block;
  margin: 0 5px;
}

/* DODANE: Styl dla radio buttonów kształtu */
.radio-shape {
    background: #f4faff;
    border: 1px solid #cce5ff;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}
.radio-shape:hover {
    background: #e2f0ff;
}

/* --- Filtry w modalu --- */
.blaty-filter-bar {
    padding: 15px 25px;
    background: #f4faff;
    border-bottom: 1px solid #e5e5e5;
}
.filter-inputs {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}
.filter-inputs input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}
.decor-max-info {
    display: block;
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

/* --- Sekcja dynamicznych otworów --- */
.add-hole-btn {
    background-color: #fff;
    color: #0073aa;
    border: 1px dashed #0073aa;
    font-weight: bold;
}
.add-hole-btn:hover {
    background-color: #f4faff;
    color: #005f8d;
}
.hole-item-box {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.remove-hole-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    width: auto !important;
}
.remove-hole-btn:hover {
    background-color: #c82333;
}

/* --- Blokada formularza --- */
.blaty-locked {
    opacity: 0.4;
    pointer-events: none;
    position: relative;
    user-select: none;
    transition: opacity 0.3s ease;
}
.blaty-lock-overlay {
    display: none; /* Domyślnie ukryte, kontrolowane przez klasę blaty-locked */
}
.blaty-locked .blaty-lock-overlay {
    display: block;
    position: absolute;
    top: 50px; /* Nieco niżej, żeby było na wysokości pierwszych wymiarów */
    left: 50%;
    transform: translateX(-50%);
    background: #d9534f;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    width: 80%;
    text-align: center;
    /* Dzięki temu myszka "przenika" przez nakładkę i widzi pointer-events:none kontenera pod spodem */
    pointer-events: none; 
}
.blaty-pulse-btn {
    animation: blaty-pulse 2s infinite;
    border: 2px solid #0073aa;
}
@keyframes blaty-pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 115, 170, 0.4); }
    70% { box-shadow: 0 0 0 12px rgba(0, 115, 170, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 115, 170, 0); }
}
/* --- Przełącznik Wizualizacji --- */
.viz-switch-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #0073aa;
    background: #f4faff;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #cce5ff;
}
.viz-switch-label input {
    display: none;
}
.viz-slider {
    width: 34px;
    height: 18px;
    background-color: #ccc;
    border-radius: 20px;
    margin-right: 10px;
    position: relative;
    transition: 0.3s;
}
.viz-slider::before {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: 0.3s;
}
.viz-switch-label input:checked + .viz-slider {
    background-color: #0073aa;
}
.viz-switch-label input:checked + .viz-slider::before {
    transform: translateX(16px);
}

/* --- Zmniejszenie fontów w oknie wyboru wzoru (Modal) --- */

/* 1. Główny tytuł: "Wybierz wzór blatu" */
.blaty-modal-header h3 {
    font-size: 20px; /* Zmniejsz lub zwiększ według uznania */
    margin: 0;
}

/* 2. Pogrubione nagłówki sekcji: "Wybierz technologię:" i "Filtruj po..." */
.blaty-filter-bar strong {
    font-size: 14px; 
}

/* 3. Etykiety przycisków wyboru: "Wszystkie", "Blaty Kompaktowe...", "Blaty Laminowane" */
.blaty-filter-bar label {
    font-size: 13px; 
    cursor: pointer;
}