/* Material-Dropdowns (Stein, Oberfläche, Stärke) — Parität zu apl3 */

.stone-selection {
  margin-bottom: 4px;
}

.stone-selection h4,
.surface-treatment h4 {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #212529;
  letter-spacing: 0.3px;
}

.stone-dropdown {
  position: relative;
  margin-bottom: 8px;
  max-width: 100%;
  width: 100%;
}

.stone-dropdown-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: #495057;
  transition: all 0.2s ease;
  text-align: left;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.stone-dropdown-btn:hover:not(:disabled) {
  border-color: #e5322d;
  background: #f8f9fa;
  box-shadow: 0 2px 4px rgba(229, 50, 45, 0.15);
}

.stone-dropdown-btn.selected {
  background: linear-gradient(135deg, #333333 0%, #2a2a2a 100%);
  border-color: #e5322d;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(229, 50, 45, 0.4);
}

.stone-dropdown-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.stone-dropdown-btn .stone-count {
  margin-left: auto;
}

.stone-dropdown-btn.selected .stone-count {
  color: #adb5bd;
  background: #444444;
  border-color: #555;
}

.stone-dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-height: min(520px, calc(100vh - 150px));
  overflow: hidden;
  display: none;
  margin-top: 4px;
}

.stone-dropdown.active .stone-dropdown-content {
  display: block;
  animation: materialDropdownFadeIn 0.25s ease-out;
}

.dropdown-search {
  padding: 8px;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
}

.dropdown-search-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  font-size: 12px;
  transition: all 0.2s ease;
  background: #ffffff;
  box-sizing: border-box;
}

.dropdown-search-input:focus {
  outline: none;
  border-color: #e5322d;
  box-shadow: 0 0 0 3px rgba(229, 50, 45, 0.1);
}

.stone-items {
  max-height: min(445px, calc(100vh - 220px));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
  box-sizing: border-box;
}

.stone-category {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 0 4px 10px;
  margin-bottom: 4px;
}

.stone-category.hidden {
  display: none;
}

.stone-category-header {
  grid-column: 1 / -1;
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 6px 8px;
  margin: 0 0 6px 0;
  border-radius: 6px;
  background: #f8f9fa;
  border: 1px solid #eceff3;
  color: #495057;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stone-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 9px;
  border: 2px solid #dee2e6;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #ffffff;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.stone-item:hover {
  border-color: #e5322d;
  background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
  transform: translateX(1px);
  box-shadow: 0 3px 10px rgba(229, 50, 45, 0.18);
}

.stone-item.selected {
  border-color: #e5322d;
  background: #e3f2fd;
  box-shadow: 0 4px 12px rgba(229, 50, 45, 0.15);
}

.stone-item.hidden {
  display: none;
}

.stone-item-name {
  font-size: 11px;
  font-weight: 600;
  color: #212529;
  text-align: center;
  line-height: 1.25;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.stone-item-image {
  display: block;
  width: 100%;
  height: 88px;
  min-height: 88px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #dee2e6;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.stone-item:hover .stone-item-image {
  border-color: #e5322d;
  transform: scale(1.03);
}

.stone-item.selected .stone-item-image {
  border-color: #e5322d;
  box-shadow: 0 2px 8px rgba(229, 50, 45, 0.2);
}

.surface-dropdown,
.thickness-dropdown {
  position: relative;
}

.sidebar-section:has(.surface-dropdown),
.sidebar-section:has(.thickness-dropdown),
.sidebar-section:has(.stone-dropdown) {
  overflow: visible;
  position: relative;
}

.sidebar-section:has(.surface-dropdown.active),
.sidebar-section:has(.thickness-dropdown.active) {
  z-index: 10025;
}

.surface-dropdown.active,
.thickness-dropdown.active {
  z-index: 10026;
}

.surface-dropdown-btn,
.thickness-dropdown-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: #495057;
  transition: all 0.2s ease;
  text-align: left;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.surface-dropdown-btn:hover:not(:disabled),
.thickness-dropdown-btn:hover:not(:disabled) {
  border-color: #e5322d;
  background: #f8f9fa;
}

.surface-dropdown-btn.selected,
.thickness-dropdown-btn.selected {
  background: linear-gradient(135deg, #333333 0%, #2a2a2a 100%);
  border-color: #e5322d;
  color: #ffffff;
}

.surface-dropdown-btn:disabled,
.thickness-dropdown-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.surface-dropdown-content,
.thickness-dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 10027;
  max-height: min(280px, calc(100vh - 120px));
  overflow: hidden;
  display: none;
  margin-top: 4px;
}

.surface-dropdown.active .surface-dropdown-content,
.thickness-dropdown.active .thickness-dropdown-content {
  display: block;
  animation: materialDropdownFadeIn 0.2s ease-out;
}

@keyframes materialDropdownFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.surface-items,
.thickness-items {
  max-height: 240px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
  box-sizing: border-box;
}

.surface-item,
.thickness-item {
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #ffffff;
  font-size: 12px;
  color: #495057;
}

.surface-item:hover,
.thickness-item:hover {
  border-color: #e5322d;
  background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
}

.surface-item.selected,
.thickness-item.selected {
  border-color: #e5322d;
  background: #e3f2fd;
}

.surface-item.hidden,
.thickness-item.hidden {
  display: none !important;
}

.configurator-thickness-select-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.configurator-dropdown-empty-hint {
  display: none;
  padding: 12px 10px;
  font-size: 12px;
  line-height: 1.45;
  color: #6c757d;
  text-align: center;
}

.configurator-dropdown-empty-hint.is-visible {
  display: block;
}

.right-sidebar.is-material-dropdown-open {
  overflow: visible;
}

.catalog-source-hint {
  margin: 6px 0 0;
  font-size: 10px;
  line-height: 1.4;
  color: #6c757d;
}

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

.input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-group label {
  font-size: 10px;
  font-weight: 500;
  color: #495057;
}

.input-group .measurement-input {
  padding: 7px 10px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 12px;
  width: 100%;
  box-sizing: border-box;
}

.measurement-inputs input::placeholder {
  color: #adb5bd;
  opacity: 1;
}

.measurement-inputs input:focus::placeholder {
  color: #ced4da;
  opacity: 0.7;
}

.input-group .measurement-input:focus {
  outline: none;
  border-color: #e5322d;
  box-shadow: 0 0 0 3px rgba(229, 50, 45, 0.1);
}
