/* Фоновая сетка */
.calculator-section {
  min-height: 100vh;
  padding: 100px 0 60px;
  position: relative;
}

.calculator-section::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: 40px 40px;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  pointer-events: none;
  z-index: -1;
}

.calculator-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.calculator-title {
  font-size: 2rem;
  font-weight: 700;
  color: white;
  text-align: center;
  margin-bottom: 1rem;
  text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
  line-height: 1.2;
}

.calculator-description {
  text-align: center;
  color: #9ca3af;
  margin-bottom: 2rem;
  font-size: 1rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 10px;
}

.calculator-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1.25rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
}

/* === ВЫБОР УСЛУГ === */
.services-selection {
  flex: 1;
}

.services-selection h2,
.calculation-result h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: white;
  margin-bottom: 1rem;
  text-align: center;
}

.service-option {
  margin-bottom: 0.75rem;
}

.service-option label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
  padding: 0.875rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  gap: 10px;
  /* Увеличенная область нажатия для мобильных */
  min-height: 52px;
  -webkit-tap-highlight-color: rgba(59, 130, 246, 0.2);
}

.service-option label:active {
  transform: scale(0.98);
}

.service-option input[type="checkbox"] {
  display: none;
}

.service-option input[type="checkbox"]:checked + label {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.service-option input[type="checkbox"]:checked + label .service-name {
  color: #60a5fa;
  font-weight: 600;
}

.service-name {
  color: #e5e7eb;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
  flex: 1;
  line-height: 1.3;
}

.service-price {
  color: #9ca3af;
  font-size: 0.9rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* === РЕЗУЛЬТАТ === */
.calculation-result {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.selected-services {
  background: rgba(10, 10, 10, 0.4);
  border-radius: 10px;
  padding: 1rem;
  min-height: 120px;
  max-height: 200px;
  overflow-y: auto;
  /* Улучшенная прокрутка на мобильных */
  -webkit-overflow-scrolling: touch;
}

.no-services {
  color: #6b7280;
  text-align: center;
  font-style: italic;
  margin: 0;
  font-size: 0.9rem;
}

.selected-service {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  gap: 10px;
}

.selected-service:last-child {
  border-bottom: none;
}

.selected-service .service-name {
  color: #e5e7eb;
  font-size: 0.9rem;
}

.selected-service .service-price {
  color: #60a5fa;
  font-weight: 600;
  font-size: 0.9rem;
}

.total-price {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(76, 61, 248, 0.1));
  border-radius: 10px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
  flex-wrap: wrap;
  gap: 8px;
}

.total-label {
  color: #93c5fd;
  font-size: 1rem;
}

.total-amount {
  color: white;
  font-size: 1.25rem;
  font-weight: bold;
}

/* === КНОПКИ === */
.calculator-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.calculator-actions .btn-primary,
.calculator-actions .btn-secondary {
  display: block;
  width: 90%;
  text-align: center;
  padding: 0.875rem 1rem;
  font-size: 0.95rem;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  color: white;
  box-shadow: 0 0 15px rgba(37, 99, 235, 0.5);
  border: none;
}

.btn-primary:hover,
.btn-primary:active {
  transform: scale(1.02);
  box-shadow: 0 0 25px rgba(37, 99, 235, 0.7);
}

.btn-secondary {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: none;
}

.btn-secondary:hover,
.btn-secondary:active {
  background: rgba(59, 130, 246, 0.25);
  color: white;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

/* === АДАПТИВНОСТЬ - ПЛАНШЕТЫ === */
@media (min-width: 576px) {
  .calculator-title {
    font-size: 2rem;
  }

  .calculator-description {
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
  }

  .calculator-content {
    padding: 1.5rem;
    gap: 2rem;
  }

  .calculator-actions {
    flex-direction: row;
  }

  .calculator-actions .btn-primary,
  .calculator-actions .btn-secondary {
    flex: 1;
  }
}

/* === АДАПТИВНОСТЬ - СРЕДНИЕ ЭКРАНЫ === */
@media (min-width: 768px) {
  .calculator-section {
    padding: 120px 0 80px;
  }

  .calculator-title {
    font-size: 2.25rem;
  }

  .services-selection h2,
  .calculation-result h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .service-name {
    font-size: 1.05rem;
  }

  .service-price {
    font-size: 1rem;
  }

  .total-label {
    font-size: 1.125rem;
  }

  .total-amount {
    font-size: 1.5rem;
  }
}

/* === АДАПТИВНОСТЬ - ДЕСКТОП === */
@media (min-width: 992px) {
  .calculator-title {
    font-size: 2.5rem;
  }

  .calculator-description {
    margin-bottom: 3rem;
  }

  .calculator-content {
    flex-direction: row;
    gap: 3rem;
    padding: 2rem;
  }

  .services-selection,
  .calculation-result {
    flex: 1;
  }

  .selected-services {
    min-height: 150px;
    max-height: 300px;
  }

  .calculator-actions {
    flex-direction: column;
  }
}

/* === МЕЛКИЕ ЭКРАНЫ === */
@media (max-width: 375px) {
  .calculator-container {
    padding: 0 12px;
  }

  .calculator-title {
    font-size: 1.5rem;
  }

  .calculator-description {
    font-size: 0.9rem;
  }

  .calculator-content {
    padding: 1rem;
  }

  .service-option label {
    padding: 0.75rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .service-price {
    align-self: flex-end;
  }

  .total-price {
    flex-direction: column;
    text-align: center;
  }

  .total-label {
    font-size: 0.9rem;
  }

  .total-amount {
    font-size: 1.5rem;
  }
}

/* === SAFE AREA для устройств с вырезами === */
@supports (padding: max(0px)) {
  .calculator-section {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(60px, env(safe-area-inset-bottom));
  }
}
