/* Scroll and Interaction Fixes for Calculators */
/* Fixes mobile scroll issues, touch targets, and input interactions */

/* Prevent body scroll locking */
html, body {
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Main page scroll */
.page {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height for mobile */
}

/* Card scroll fix - allow vertical scroll */
.card, .info-card {
  overflow: visible;
  -webkit-overflow-scrolling: touch;
}

/* Select dropdowns - bigger touch targets */
select {
  min-height: 44px; /* Apple HIG minimum touch target */
  font-size: 16px; /* Prevents iOS zoom on focus */
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* Input fields - prevent zoom */
input, textarea {
  font-size: 16px; /* Prevents iOS zoom on focus */
  min-height: 44px;
  touch-action: manipulation;
}

/* Number inputs - allow scroll */
input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Pill buttons - better touch targets */
.pill-btn {
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Checkbox containers - bigger touch area */
.extras-row label {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: manipulation;
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* Form rows - prevent overflow */
.row, .form-row {
  overflow: visible;
}

/* Result card scroll */
.result-card {
  overflow: visible;
  max-height: none;
}

/* Lead form - scrollable on mobile */
.lead-card {
  overflow: visible;
}

/* Button touch targets */
.btn-primary, .btn-secondary {
  min-height: 48px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Prevent horizontal scroll on mobile */
@media (max-width: 960px) {
  .shell {
    overflow-x: hidden;
  }

  .page {
    padding-left: 12px;
    padding-right: 12px;
  }

  /* Stack pill buttons vertically if needed */
  .pill-row {
    flex-wrap: wrap;
  }

  .pill-btn {
    flex: 1 1 auto;
    min-width: calc(33% - 6px);
  }
}

/* Small mobile fixes */
@media (max-width: 540px) {
  .pill-btn {
    min-width: calc(50% - 4px);
    padding: 10px 8px;
    font-size: 11px;
  }

  select, input, textarea {
    padding: 12px 10px;
  }
}

/* File input styling */
input[type="file"] {
  min-height: 44px;
  padding: 10px;
  cursor: pointer;
}

/* Prevent double-tap zoom */
* {
  touch-action: manipulation;
}

/* Smooth scroll for the whole page */
html {
  scroll-behavior: smooth;
}

/* Focus states for accessibility */
select:focus,
input:focus,
textarea:focus,
button:focus,
.pill-btn:focus {
  outline: 2px solid var(--accent, #f97316);
  outline-offset: 2px;
}

/* Disabled state */
button:disabled,
.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
