/* --- Twoje nowe style techniczne --- */
.p4u-cascade .form-group { margin-bottom: 12px; }
.p4u-cascade select.form-control { width: 100%; }
.p4u-cascade .select2-container { width: 100% !important; }
.p4u-cascade .form-group.p4u-disabled .select2-container .select2-selection--single,
.p4u-cascade .form-group .select2-container .select2-selection--single { min-height: 38px; height: 38px; }
.p4u-cascade .form-group.p4u-disabled .select2-container .select2-selection__rendered,
.p4u-cascade .form-group .select2-container .select2-selection__rendered { line-height: 38px; }
.p4u-cascade .form-group.p4u-disabled .select2-container .select2-selection__arrow,
.p4u-cascade .form-group .select2-container .select2-selection__arrow { height: 38px; }
.p4u-cascade .form-group.p4u-disabled .select2-container .select2-selection--single { background-color: #f5f5f5; opacity: 1; }
.p4u-cascade .form-group.p4u-disabled select.form-control { opacity: 1; }
.p4u-cascade .p4u-outside-label { margin-bottom: 6px; font-weight: 500; }

/* Consistent dimensions for native selects (active and disabled) */
.p4u-cascade select.form-control,
.p4u-cascade select.form-control:disabled {
	height: 38px;
	min-height: 38px;
	line-height: 38px;
	box-sizing: border-box;
}

/* Ensure Select2 single matches the same height in all states */
.p4u-cascade .select2-container .select2-selection--single { height: 38px; }
.p4u-cascade .select2-container .select2-selection--single .select2-selection__rendered { line-height: 38px; }
.p4u-cascade .select2-container .select2-selection--single .select2-selection__arrow { height: 38px; }
.p4u-cascade .select2-container--default.select2-container--disabled .select2-selection--single { height: 38px; }
.p4u-cascade .select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__rendered { line-height: 38px; }

/* --- Poprzednie style wizualne --- */
.p4u-cascade {
  max-width: 100%;
  margin: auto;
  margin-bottom: 20px !important;
  padding: 50px;
  border-radius: 4px;
  background-color: #FFFFFF;
  color: #3A3A3A; /* kolor tekstu */
}

.p4u-cascade-title {
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 20px;
  position: relative;
color: #232323;
}

.p4u-cascade-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background-color: #F2A234; /* kolor kreski */
  margin: 10px auto 0;
  border-radius: 2px;
}

.p4u-cascade-selects {
  display: flex;
  flex-wrap: wrap;
  gap: 30px; /* większy odstęp */
  justify-content: center;
  align-items: center;
}

.p4u-cascade-selects .form-group {
  flex: 1 1 40%; /* ~25% szerokości */
  min-width: 180px;
}

.form-group {
  margin-bottom: 0 !important;
}

.p4u-cascade-selects select.form-control {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  transition: all 0.3s ease;
  color: #3A3A3A; /* kolor czcionki */
}

.p4u-cascade-selects select.form-control:focus {
  border-color: #007bff;
  box-shadow: 0 0 6px rgba(0, 123, 255, 0.4);
}

.p4u-cascade-selects select.form-control.has-value {
  border-color: #28a745;
  background-color: #f9fff9;
}

.p4u-search-btn {
  flex: 1 1 25%;
  min-width: 180px;
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: linear-gradient(90deg, #F2A234, #d8891c); /* pomarańczowy */
  color: #fff;
  transition: background 0.3s ease, transform 0.2s ease;
}

.p4u-search-btn:hover {
  background: linear-gradient(90deg, #d8891c, #b66f14);
  transform: translateY(-2px);
}

.p4u-outside-label {
  font-size: 14px;
  font-weight: 500;
  color: #3A3A3A;
  margin-bottom: 5px;
}

.select2-results{
  background-color: #FFFFFF !important;
}

/* Ukryj pustą, zaznaczoną opcję w dropdown */
.select2-results__option--selected:empty {
  display: none !important;
}

/* Na urządzeniach mobilnych ogranicz dropdown Select2 */
@media (max-width: 768px) {
  .select2-results__options {
    max-height: 120px !important; /* ~3 wiersze */
    overflow-y: auto !important;  /* przewijanie */
  }
}

/* Stylizacja opcji w dropdownie Select2 */
.select2-results__option.select2-results__option--selectable,
.select2-selection__rendered {
  font-weight: 500;
  color: #333;
}

/* Upodobnienie natywnego selecta do Select2 */
.p4u-cascade select.form-control {
  height: 38px;
  min-height: 38px;
  line-height: 38px;
  border: 1px solid #aaa;
  border-radius: 4px;
  background-color: #fff;
  padding: 0 8px;
  font-size: 14px;
  color: #333;
  appearance: none; /* ukrywa strzałkę systemową */
  -moz-appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%204%205'%3E%3Cpath%20fill='%23666'%20d='M2%200L0%202h4zm0%205L0%203h4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 8px 10px;
}

.select2-search--dropdown{

background-color: white !important;
}

/* Spinner/Loader styles */
.p4u-cascade-loading {
  position: relative;
  min-height: 100px;
}

.p4u-cascade-loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #F2A234;
  border-radius: 50%;
  animation: p4u-spin 1s linear infinite;
  z-index: 10;
}

.p4u-cascade-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(1px);
  z-index: 5;
}

@keyframes p4u-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

