@scope ([data-cable-calculator="conditions"]) {

:scope {
  --color: #0056b3;
  --primary-hover: #004494;
  --primary-light: #e6f0fa;
  --secondary-color: #6c757d;
  --secondary-hover: #5a6268;
  --success-color: #28a745;
  --success-bg: #d4edda;
  --warning-color: #ffc107;
  --warning-bg: #fff3cd;
  --error-color: #dc3545;
  --error-bg: #f8d7da;
  --bg-color: #f5f7fa;
  --card-bg: #ffffff;
  --text-color: #212529;
  --text-muted: #6c757d;
  --border-color: #dee2e6;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: all 0.2s ease;
}

body {
  background-color: var(--bg-color);
}
.btn span {
	padding: 1.25rem 2rem;
	font-size: 1rem;
}


/* Calculator layout */
.calculator {
  display: grid;
  gap: 1.5rem;
	grid-template-columns: 1fr 1fr;
	max-width: 1000px;
}

.calculator .form-group {
  background: transparent;
  margin: 0;
}

/* Cards */
.calculator-cards {
	background: #fff;
	border-radius: var(--radius-lg);
	padding: 2rem;
	border: 1px solid var(--border-color);
}

.calculator-title {
	color: var(--color);
	font-size: 1.5rem;
  margin-bottom: 2rem;
	font-weight: var(--f1ws);
}

/* Form */
.form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-color);
}

.form-group label::after {
  content: "";
}

.form-group:has([required]) label::after {
  content: " *";
  color: var(--error-color);
}

.form-group input,
.form-group select {
  padding: 1rem;
  border: 0;
  border-radius: var(--radius);
  font-size: 1rem;
	background: #e6edf5;
	color: #606d79;
  transition: var(--transition);
}


.form-group input::placeholder {
	color: #606d79;
}

/* Подсказка под полем */
.field-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Описание для выбранного значения селекта */
.field-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-color);
  border-radius: var(--radius);
  border-left: 3px solid var(--color);
  font-style: italic;
}

.field-description:empty {
  display: none;
}

/* Поле марки кабеля с отступом для стрелки комбобокса */
#brand {
  padding-right: 2.5rem;
}

/* Dropdown список */
.brand-dropdown {
  background: var(--card-bg);
  border-radius: var(--radius);
  margin-top: 0.25rem;
  padding: 0;
}

.brand-dropdown:not(.hidden) {
  display: block;
}

.brand-dropdown-list {
  padding: 0.5rem 0;
}

.dropdown-item {
  transition: var(--transition);
  border-bottom: 1px solid var(--bg-color);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.brand-name {
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.95rem;
}

.analog-badge {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--warning-color);
  margin-left: 0.5rem;
}
.analog-badge span {
  background: var(--warning-bg);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

.dropdown-manufacturer {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.manufacturer-our {
  color: var(--color);
  font-weight: 500;
}

.manufacturer-competitor {
  color: var(--text-muted);
}

.dropdown-more {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
  border-top: 1px solid var(--border-color);
}

.dropdown-no-results {
  color: var(--text-muted);
  font-style: italic;
}

.help-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Buttons */
.btn-primary {
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color);
  padding: 0.5rem 2rem;
  border: 1px solid var(--border-color);
  margin-left: 0.5rem;
}
.btn-copy {
  position: relative;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--color);
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  margin-left: 0.5rem;
}
.btn-primary:hover,
.btn-copy:hover {
  background: var(--primary-light);
  border-color: var(--color);
}

/* Result card */
.result-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
/* Изображение кабеля */
.cable-image {
  width: auto;
  max-width: 100%;
  height: 200px;
  object-fit: contain;
}

.result-card__name-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
}

.result-card__name-label {
  width: 100%;
  font-size: 1.1rem;
  font-weight: 500;
}
.cable-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color);
  word-break: break-all;
  flex: 1;
}

.info {
  margin: 1rem 0;
  color: var(--text-muted);
}

.info small {
  font-size: 1rem;
}

#cable-description {
}

.info__label {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-color);
}

.cable-info p {
  color: var(--text-muted);
  line-height: 1.6;
}

.result-card footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Utilities */
.hidden {
  display: none !important;
}

/* tooltip notification */
*:has(>.tooltip):hover .tooltip, .tooltip.active {
    opacity: 1;
}

.tooltip {
    position: absolute;
    right: 50%;
    bottom: calc(100% + 1rem);
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.2;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10;
    color: #f5f6f8;
    font-size: 0.8rem;
    border-radius: 4px;
    width: max-content;
    max-width: 300px;
    box-shadow: 0 5px 20px rgb(0 0 0 / 30%);
    transform: translate(50%);
    pointer-events: none;
    opacity: 0;
    transition: all 0.2s ease;
}

.tooltip::before {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.75rem 0.5rem 0 0.5rem;
  border-color: rgba(0, 0, 0, 0.85) transparent transparent;
  right: calc(50% - 0.5rem);
  bottom: -0.75rem;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Responsive */
@media (max-width: 640px) {
  .calculator {
	grid-template-columns: 1fr;
}
  .form-card,
  .result-card {
    padding: 1.25rem;
  }

  .cable-name {
    font-size: 1.25rem;
  }
}

/* Print styles */
@media print {
  .form-card,
  .btn-copy,
  .footer {
    display: none !important;
  }

  .result-card {
    box-shadow: none;
    border: 1px solid var(--border-color);
  }

  .cable-name {
    font-size: 2rem;
  }
}

}
