/* ==========================================
   Калькулятор пропорций — специфичные стили
   calc-ratio.css (зависит от calc-base.css)
   ========================================== */

/* --- Переключатель режимов --- */
.cc-calc-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
}

.cc-calc-mode-btn {
  padding: 14px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: 'Montserrat', sans-serif;
  color: #999;
  transition: all 0.2s ease;
}

.cc-calc-mode-btn:hover {
  background: rgba(102,126,234,0.03);
}

.cc-calc-mode-btn--active {
  background: rgba(102,126,234,0.08);
  color: #667eea;
}

.cc-calc-mode-btn--inactive {
  background: #fafafa;
  color: #999;
}

/* --- Быстрые кнопки --- */
.cc-calc-quick-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.cc-calc-quick-btn {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  transition: all 0.2s ease;
}

.cc-calc-quick-btn:hover {
  border-color: #667eea;
  color: #667eea;
  background: rgba(102,126,234,0.03);
}

/* --- Чипсы пропорций --- */
.cc-calc-ratio-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.cc-calc-ratio-chip {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Montserrat', sans-serif;
  line-height: 1;
}

.cc-calc-ratio-chip:hover {
  border-color: #667eea;
  color: #667eea;
}

.cc-calc-ratio-chip--active {
  background: rgba(102,126,234,0.08);
  border-color: #667eea;
  color: #667eea;
}

.cc-calc-ratio-chip small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #999;
  margin-top: 4px;
  line-height: 1.3;
}

.cc-calc-ratio-chip--active small {
  color: #667eea;
}

/* --- Своя пропорция --- */
.cc-calc-custom-ratio {
  display: none;
  gap: 10px;
  margin-top: 12px;
  align-items: center;
}

.cc-calc-custom-ratio--visible {
  display: flex;
}

.cc-calc-custom-ratio .cc-calc-input {
  max-width: 100px;
  text-align: center;
}

.cc-calc-custom-ratio__sep {
  font-size: 18px;
  font-weight: 700;
  color: #999;
}

/* --- Микстон toggle --- */
.cc-calc-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.cc-calc-toggle-label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
}

.cc-calc-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.cc-calc-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cc-calc-toggle__track {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cc-calc-toggle__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.cc-calc-toggle input:checked + .cc-calc-toggle__track {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.cc-calc-toggle input:checked + .cc-calc-toggle__track::after {
  transform: translateX(20px);
}

/* --- Микстон блок --- */
.cc-calc-miston-body {
  display: none;
}

.cc-calc-miston-body--visible {
  display: block;
}

/* --- Справочная таблица --- */
.cc-calc-ratio-table-wrap {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
}

.cc-calc-ratio-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.cc-calc-ratio-table th {
  text-align: left;
  padding: 12px 16px;
  background: rgba(102,126,234,0.06);
  color: #667eea;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid #e0e0e0;
}

.cc-calc-ratio-table td {
  padding: 12px 16px;
  color: #666;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
  line-height: 1.5;
}

.cc-calc-ratio-table tr:last-child td {
  border-bottom: none;
}

.cc-calc-ratio-table td:first-child {
  font-weight: 700;
  color: #1a1a2e;
  white-space: nowrap;
}

.cc-calc-ratio-table td:nth-child(2) {
  color: #444;
}

/* --- Кнопка сброса --- */
.cc-calc-reset-btn {
  background: none;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  color: #999;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cc-calc-reset-btn:hover {
  border-color: #dc3545;
  color: #dc3545;
}

/* --- Мобильная адаптация --- */
@media (max-width: 768px) {
  .cc-calc-mode-btn {
    min-height: 48px;
    font-size: 14px;
  }

  .cc-calc-quick-btns {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .cc-calc-quick-btn {
    flex-shrink: 0;
  }

  .cc-calc-ratio-chip {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
  }

  .cc-calc-ratio-table {
    font-size: 13px;
  }

  .cc-calc-ratio-table th,
  .cc-calc-ratio-table td {
    padding: 10px 12px;
  }

  .cc-calc-custom-ratio--visible {
    flex-wrap: wrap;
  }

  .cc-calc-custom-ratio .cc-calc-input {
    max-width: 80px;
  }
}
