/* ===== ОСНОВНАЯ СТРУКТУРА СТРАНИЦЫ ===== */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 15px;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  align-items: start;
  position: relative;
}

/* Левая колонка с контентом */
.content-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

/* Правая колонка с калькулятором - FIXED ПОЗИЦИОНИРОВАНИЕ */
.calculator-sticky-container {
  position: fixed;
  top: 100px;
  right: calc((100% - 1400px) / 2 + 15px);
  width: 360px;
  align-self: start;
  z-index: 1000;
  transition: top 0.2s ease;
}

/* ===== КАРТОЧКА КАЛЬКУЛЯТОРА ===== */
.calculator-card {
  background: var(--secondary);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #FDC018 #f5f5f5;
}

/* Стилизация скроллбара */
.calculator-card::-webkit-scrollbar {
  width: 3px;
}

.calculator-card::-webkit-scrollbar-track {
  background: #f5f5f5;
}

.calculator-card::-webkit-scrollbar-thumb {
  background: #FDC018;
}

/* ===== ЗАГОЛОВОК КАЛЬКУЛЯТОРА ===== */
.calculator__header {
  margin-bottom: 12px;
}

.calculator__title {
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-medium);
  margin: 0 0 2px;
  color: var(--primary-text);
}

.calculator__subtitle {
  font-size: 12px;
  color: var(--secondary-text);
  margin: 0;
}

/* ===== СЕКЦИИ КАЛЬКУЛЯТОРА ===== */
.calculator__section {
  padding-bottom: 5px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}

.calculator__section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.section__title {
  font-size: 12px;
  color: var(--primary-text);
  margin: 5px 0;
  letter-spacing: 0.2px;
}

/* ===== СЕТКА ДЛЯ ПОЛЕЙ ===== */
.fields-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ===== ПОЛЯ ФОРМЫ ===== */
.calculator__fields-container {
  display: flex;
  flex-direction: column;
}

.calculator__field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.field__label {
  font-size: 11px;
  font-weight: 500;
  color: var(--secondary-text);
  display: flex;
  align-items: center;
  gap: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.field__required {
  color: #f44336;
  font-size: 11px;
}

/* Выпадающие списки */
.field__select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: var(--font-size-p);
  background: var(--secondary);
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
}

/* Текстовые поля */
.field__input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: var(--font-size-p);
  transition: border-color 0.2s;
}

.field__input:focus,
.field__select:focus {
  outline: none;
  border-color: var(--focus-text);
}

/* ===== ЧЕКБОКСЫ ===== */
.field__checkbox-group {
  display: grid;
  gap: 6px;
  background: var(--secondary);
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: var(--font-size-p);
  padding: 2px 0;
}

.checkbox-option input[type="checkbox"] {
  width: 12px;
  height: 12px;
  cursor: pointer;
  accent-color: var(--focus-text);
  margin: 0;
}

.checkbox-option__label {
  color: var(--secondary-text);
  line-height: 1.2;
}

/* Одиночный чекбокс (для срочности) */
.checkbox-option--single {
  background: var(--secondary);
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-bottom: 0;
}

/* ===== КОНТАКТНЫЕ ДАННЫЕ В ОДНУ СТРОКУ ===== */
.contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
}

.contact-row .calculator__field {
  margin-bottom: 0;
}

/* ===== ИКОНКА ДЛЯ ЗАГРУЗКИ ФАЙЛА ===== */
.file-icon-field {
  margin-bottom: 0;
}

.file-icon-label {
  display: block;
  cursor: pointer;
  width: 100%;
}

.file-icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 6px 10px;
  background: var(--secondary);
  border-radius: 6px;
  font-size: 11px;
  color: var(--focus-text);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  box-sizing: border-box;
}

.file-icon-button:hover {
  background: var(--focus-text);
  border-color: var(--focus-text);
  color: #333;
}

.file-icon-button svg {
  width: 14px;
  height: 14px;
}

.field__file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.file-hint {
  display: block;
  font-size: 8px;
  color: var(--secondary-text);
  margin-top: 2px;
  text-align: center;
}

/* ===== СПИСОК ФАЙЛОВ (КОМПАКТНЫЙ) ===== */
.selected-files-container {
  margin: 6px 0 2px;
}

.files-list {
  background: var(--secondary);
  border-radius: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  max-height: 100px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.files-list::-webkit-scrollbar {
  width: 3px;
}

.files-list::-webkit-scrollbar-track {
  background: #f0f0f0;
}

.files-list::-webkit-scrollbar-thumb {
  background: #FDC018;
  border-radius: 3px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 5px;
  background: var(--secondary);
  border-radius: 3px;
  margin-bottom: 2px;
  font-size: 9px;
  border: 1px solid var(--border);
}

.file-item:last-child {
  margin-bottom: 0;
}

.file-icon {
  font-size: 10px;
  min-width: 14px;
  text-align: center;
}

.file-name {
  flex: 1;
  font-size: 9px;
  color: var(--primary-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: 8px;
  color: #888;
  white-space: nowrap;
  margin-right: 2px;
}

.file-remove {
  width: 14px;
  height: 14px;
  border: none;
  background: #ff4444;
  color: white;
  border-radius: 50%;
  font-size: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
  line-height: 1;
}

.file-remove:hover {
  background: #cc0000;
  transform: scale(1.1);
}

/* ===== КАСТОМНЫЕ ПОЛЯ ===== */
.hidden {
  display: none !important;
}

#custom-format-container,
#custom-quantity-container,
#custom-pages-container {
  margin-top: 4px;
}

/* ===== ФИКСИРОВАННЫЙ ФУТЕР ===== */
.calculator__fixed-footer {
  position: sticky;
  bottom: 0;
  background: var(--secondary);
  padding: 8px 0 0;
  margin-top: 8px;
  z-index: 20;
  border-top: 1px solid var(--border);
}

/* Политика конфиденциальности в футере */
.calculator__privacy {
  margin: 0 0 6px 0;
  text-align: center;
}

.privacy__note {
  font-size: 9px;
  color: var(--primary);
  margin: 0;
  line-height: 1.3;
}

.privacy__note a {
  color: #FDC018;
  text-decoration: none;
}

.privacy__note a:hover {
  text-decoration: underline;
}

/* Контейнер для кнопки отправки */
.calculator__submit-wrapper {
  margin: 0;
}

/* Кнопка отправки */
.calculator__submit {
  width: 100%;
  padding: 8px;
  background: #FDC018;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(253,192,24,0.2);
}

.calculator__submit:hover {
  background: #e5ac16;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(253,192,24,0.3);
}

.calculator__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.calculator__submit.loading {
  opacity: 0.8;
  cursor: wait;
  position: relative;
}

.calculator__submit.loading::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid var(--border);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

@keyframes spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

/* ===== ИНДИКАТОР ЗАГРУЗКИ ===== */
.upload-progress {
  margin: 8px 0;
  padding: 8px;
  background: #f5f5f5;
  border-radius: 6px;
}

.progress-bar-container {
  width: 100%;
  height: 12px;
  background: #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 4px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #4caf50, #8bc34a);
  border-radius: 6px;
  transition: width 0.2s ease;
}

.progress-text {
  font-size: 9px;
  font-weight: 600;
  color: #4caf50;
  text-align: right;
  margin-bottom: 2px;
}

.progress-status {
  font-size: 9px;
  color: #666;
  text-align: center;
  margin-bottom: 2px;
}

.progress-files {
  font-size: 8px;
  color: #888;
  text-align: center;
}

/* ===== ХЛЕБНЫЕ КРОШКИ ===== */
.breadcrumbs {
  margin: 15px 0 5px;
  font-size: 12px;
}

.breadcrumbs a {
  color: #888;
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: #FDC018;
}

.breadcrumbs__separator {
  color: #ccc;
  margin: 0 5px;
}

.breadcrumbs__current {
  color: #333;
  font-weight: 500;
}

/* ===== УВЕДОМЛЕНИЯ ===== */
.calculator-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  min-width: 250px;
  max-width: 350px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.15);
  animation: slideInRight 0.3s ease;
}

.calculator-notification--success {
  border-left: 3px solid #4caf50;
}

.calculator-notification--error {
  border-left: 3px solid #f44336;
}

.notification__content {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.notification__message {
  color: #333;
  font-size: 12px;
  line-height: 1.4;
}

.notification__close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #999;
  padding: 0 4px;
}

.notification__close:hover {
  color: #333;
}

/* ===== АНИМАЦИИ ===== */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1400px) {
  .main-content {
    max-width: 1200px;
  }
  
  .calculator-sticky-container {
    right: calc((100% - 1200px) / 2 + 15px);
    width: 340px;
  }
}

@media (max-width: 1200px) {
  .main-content {
    max-width: 100%;
    padding: 15px;
  }
  
  .calculator-sticky-container {
    right: 15px;
    width: 320px;
  }
  
  .calculator-card {
    padding: 14px;
  }
}

@media (max-width: 992px) {
  .main-content {
    grid-template-columns: 1fr;
  }
  
  .calculator-sticky-container {
    position: static;
    width: 100%;
    margin-top: 20px;
  }
  
  .contact-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 12px;
  }
  
  .calculator-card {
    padding: 12px;
  }
  
  .fields-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 8px;
    gap: 12px;
  }
  
  .calculator-card {
    padding: 10px;
  }
  
  .calculator__fixed-footer {
    padding: 6px 0 0;
  }
  
  .privacy__note {
    font-size: 8px;
  }
  
  .calculator__submit {
    padding: 7px;
    font-size: 11px;
  }
  
  .file-icon-button {
    padding: 5px 8px;
    font-size: 10px;
  }
  
  .file-icon-button svg {
    width: 12px;
    height: 12px;
  }
  
  .file-item {
    padding: 2px 4px;
    font-size: 8px;
  }
  
  .file-name {
    font-size: 8px;
  }
  
  .file-size {
    font-size: 7px;
  }
  
  .file-remove {
    width: 12px;
    height: 12px;
    font-size: 7px;
  }
  
  .contact-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  
  .file-icon-button {
    padding: 5px 8px;
    font-size: 10px;
  }
  
  .file-icon-button svg {
    width: 12px;
    height: 12px;
  }
  
  .calculator-notification {
    left: 10px;
    right: 10px;
    min-width: auto;
  }
}

/* ===== ДЛЯ ОЧЕНЬ МАЛЕНЬКИХ ЭКРАНОВ ===== */
@media (max-width: 360px) {
  .calculator-card {
    padding: 8px;
  }
  
  .field__checkbox-group {
    padding: 6px;
  }
  
  .checkbox-option {
    gap: 4px;
  }
  
  .checkbox-option input[type="checkbox"] {
    width: 10px;
    height: 10px;
  }
  
  .file-item {
    flex-wrap: wrap;
    position: relative;
    padding-right: 20px;
  }
  
  .file-remove {
    position: absolute;
    top: 2px;
    right: 2px;
  }
}