/* ============== Floating Action Button (FAB) ============== */
/* Lift the theme's back-to-top arrow above the FAB so they stack neatly */
.btntoTop { bottom: 90px !important; right: 24px !important; }

.quote-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ec3323;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 22px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(236, 51, 35, 0.4);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.quote-fab:hover {
  background: #ca3d26;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(236, 51, 35, 0.5);
}
.quote-fab:focus { outline: none; }
.quote-fab-icon { font-size: 18px; line-height: 1; }
.quote-fab-text { white-space: nowrap; }
body.modal-open .quote-fab { display: none; }

@media (max-width: 575px) {
  .quote-fab {
    right: 16px;
    bottom: 16px;
    padding: 12px 18px;
    font-size: 13px;
  }
  .btntoTop { bottom: 78px !important; right: 16px !important; }
}

/* ============== Modal shell ============== */
#quoteModal { z-index: 999999 !important; }
.modal-backdrop.show { z-index: 999998 !important; }

#quoteModal .modal-dialog { max-width: 720px; }
#quoteModal .modal-content { background: #fff; }
#quoteModal .modal-header { background: #111; color: #fff; }
#quoteModal .modal-header .close { color: #fff; opacity: 1; }
#quoteModal .modal-title { font-weight: 700; }
#quoteModal .modal-body { padding: 24px; background: #fff; }

/* ============== Progress bar ============== */
.quote-progress { display: flex; justify-content: space-between; margin-bottom: 24px; position: relative; }
.quote-progress::before {
  content: ""; position: absolute; top: 14px; left: 0; right: 0;
  height: 2px; background: #ddd; z-index: 0;
}
.quote-progress-step {
  flex: 1; text-align: center; position: relative; z-index: 1;
  cursor: default;
}
.quote-progress-step .circle {
  display: inline-block; width: 30px; height: 30px; line-height: 30px;
  border-radius: 50%; background: #ddd; color: #555; font-weight: 700;
}
.quote-progress-step .label { display: block; margin-top: 6px; font-size: 13px; color: #888; }
.quote-progress-step.completed .circle { background: #ec3323; color: #fff; cursor: pointer; }
.quote-progress-step.completed .label { color: #555; }
.quote-progress-step.active .circle { background: #111; color: #fff; }
.quote-progress-step.active .label { color: #111; font-weight: 700; }

/* ============== Form ============== */
.quote-step { display: none; }
.quote-step.active { display: block; }
.quote-step .form-group { margin-bottom: 14px; }
.quote-step label { font-weight: 600; font-size: 14px; margin-bottom: 4px; display: block; }
.quote-step .required::after { content: " *"; color: #d33; }
.quote-step input[type=text],
.quote-step input[type=email],
.quote-step input[type=tel],
.quote-step input[type=number],
.quote-step input[type=date],
.quote-step input[type=time],
.quote-step select,
.quote-step textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px;
}
.quote-step textarea { min-height: 70px; resize: vertical; }
.quote-step .field-error { color: #d33; font-size: 12px; margin-top: 4px; display: none; }
.quote-helper { color: #6c757d; font-size: 12px; line-height: 1.4; margin-top: 4px; }
.quote-step .has-error input,
.quote-step .has-error select,
.quote-step .has-error textarea { border-color: #d33; }
.quote-step .has-error .field-error { display: block; }
.quote-row { display: flex; gap: 12px; }
.quote-row .form-group { flex: 1; }
.quote-row.quote-row-tight { align-items: flex-start; }
.quote-conditional { display: none; padding-left: 20px; border-left: 3px solid #ec3323; margin: 8px 0 14px; }
.quote-conditional.visible { display: block; }

/* Quote modal nice-select fix */
#quoteModal .nice-select {
  width: 100% !important;
  min-height: 42px !important;
  line-height: 40px !important;
  float: none !important;
  display: block !important;
  padding: 0 38px 0 12px !important;
  border: 1px solid #ccc !important;
  border-radius: 4px !important;
  background: #fff !important;
  box-shadow: none !important;
  margin-bottom: 0 !important;
}
#quoteModal .nice-select::after {
  right: 14px !important;
  border-color: #ec3323 !important;
}
#quoteModal .nice-select .current {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
#quoteModal .nice-select .list {
  width: 100% !important;
  max-height: 220px;
  overflow-y: auto;
  border-radius: 4px !important;
}
#quoteModal .has-error .nice-select {
  border-color: #d33 !important;
}

/* Checkbox rows */
.quote-checkbox { background: #fafafa; border: 1px solid #eee; border-radius: 4px; padding: 10px 14px; margin-bottom: 10px; }
.quote-checkbox-inline { margin-top: 4px; }
.quote-checkbox-label { display: flex !important; align-items: center; gap: 10px; cursor: pointer; margin: 0 !important; font-weight: 500 !important; color: #333; }
.quote-checkbox-label input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; flex-shrink: 0; margin: 0; accent-color: #ec3323; }
.quote-checkbox-label span { line-height: 1.2; }

/* ============== Footer buttons ============== */
#quoteModal .modal-footer { justify-content: space-between; }
.quote-btn { padding: 10px 24px; border: none; border-radius: 4px; font-weight: 700; cursor: pointer; }
.quote-btn-back { background: #eee; color: #333; }
.quote-btn-next { background: #111; color: #fff; }
.quote-btn-submit { background: #ec3323; color: #fff; }
.quote-btn[disabled] { opacity: 0.6; cursor: not-allowed; }
.quote-btn .spinner { display: none; margin-right: 6px; }
.quote-btn.loading .spinner { display: inline-block; }
.quote-form-error { color: #d33; margin-bottom: 10px; font-size: 14px; display: none; }
.quote-form-error.visible { display: block; }

/* ============== Success panel ============== */
.quote-success { display: none; text-align: center; padding: 40px 20px; }
.quote-success.visible { display: block; }
.quote-success .check { font-size: 48px; color: #28a745; margin-bottom: 12px; }
.quote-success h3 { margin-bottom: 12px; }
.quote-success p { color: #555; margin-bottom: 20px; }

/* ============== Mobile (phones) ============== */
@media (max-width: 767px) {
  #quoteModal .modal-dialog {
    margin: 0;
    max-width: 100%;
    min-height: 100vh;
  }
  #quoteModal .modal-content {
    min-height: 100vh;
    border-radius: 0;
    border: none;
  }
  #quoteModal .modal-header { padding: 14px 16px; }
  #quoteModal .modal-title { font-size: 16px; }
  #quoteModal .modal-body { padding: 16px; }
  #quoteModal .modal-footer { padding: 12px 16px; position: sticky; bottom: 0; background: #fff; }

  .quote-progress { margin-bottom: 18px; }
  .quote-progress-step .label { display: none; }
  .quote-progress-step .circle { width: 26px; height: 26px; line-height: 26px; font-size: 13px; }
  .quote-progress::before { top: 12px; }

  .quote-row { flex-direction: column; gap: 0; }
  .quote-step .form-group { margin-bottom: 12px; }
  .quote-step label { font-size: 13px; }
  .quote-step input,
  .quote-step select,
  .quote-step textarea { font-size: 16px; padding: 10px 12px; } /* 16px prevents iOS zoom */
  #quoteModal .nice-select { min-height: 46px !important; line-height: 44px !important; }

  .quote-checkbox { padding: 10px 12px; }
  .quote-checkbox-label { font-size: 14px !important; }

  .quote-conditional { padding-left: 12px; }

  .quote-btn { padding: 10px 16px; font-size: 14px; flex: 1; }
  #quoteModal .modal-footer .quote-btn-back[style*="hidden"] { display: none; }

  .quote-success { padding: 30px 16px; }
  .quote-success h3 { font-size: 18px; }
  .quote-success p { font-size: 14px; }
}
