/**
 * Australian Automatic Doors Co. - Quote Modal & Trigger Styles
 * Strictly scoped to prevent icon blowout or conflicts with WordPress/Elementor themes
 */

/* Explicit Icon Constraints (prevents oversized SVG icons) */
.aad-quote-modal svg,
.aad-btn-icon svg,
.aad-quote-trigger svg {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  display: inline-block !important;
  vertical-align: middle !important;
  flex-shrink: 0 !important;
}

/* Button Classes for Elementor Trigger */
.aad-quote-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.25;
  text-decoration: none;
  box-sizing: border-box;
}

.aad-btn-red {
  background-color: #C73535;
  color: #ffffff !important;
  border: 1px solid #C73535;
  padding: 10px 22px;
  font-size: 14px;
}
.aad-btn-red:hover {
  background-color: #b02a2a;
  border-color: #b02a2a;
  color: #ffffff !important;
}

.aad-btn-navy {
  background-color: #12263F;
  color: #ffffff !important;
  border: 1px solid #12263F;
  padding: 10px 22px;
  font-size: 14px;
}
.aad-btn-navy:hover {
  background-color: #0B1B2B;
  border-color: #0B1B2B;
  color: #ffffff !important;
}

.aad-btn-outline {
  background-color: transparent;
  color: #12263F !important;
  border: 1px solid #cbd5e1;
  padding: 10px 22px;
  font-size: 14px;
}
.aad-btn-outline:hover {
  background-color: #f8fafc;
  border-color: #12263F;
  color: #12263F !important;
}

.aad-btn-sm {
  font-size: 12px;
  padding: 7px 14px;
}

.aad-btn-lg {
  font-size: 16px;
  padding: 14px 28px;
}

/* Modal Overlay */
.aad-quote-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(11, 27, 43, 0.78);
  backdrop-filter: blur(4px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  box-sizing: border-box;
}

.aad-quote-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* Modal Window */
.aad-quote-window {
  background: #ffffff;
  border-radius: 8px;
  width: 100%;
  max-width: 740px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transform: translateY(16px);
  transition: transform 0.25s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #252B32;
  box-sizing: border-box;
}

.aad-quote-overlay.is-active .aad-quote-window {
  transform: translateY(0);
}

/* Header */
.aad-quote-header {
  padding: 18px 24px;
  background: #12263F;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid #C73535;
}

.aad-quote-header h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: #ffffff;
  line-height: 1.2;
}

.aad-quote-header p {
  font-size: 12px;
  color: #cbd5e1;
  margin: 4px 0 0 0;
}

.aad-quote-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s ease;
}
.aad-quote-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Stepper Bar */
.aad-quote-stepper {
  display: flex;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  padding: 10px 24px;
  gap: 8px;
  overflow-x: auto;
}

.aad-step-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
  white-space: nowrap;
}

.aad-step-indicator.active {
  color: #12263F;
  font-weight: 700;
}

.aad-step-indicator.completed {
  color: #059669;
}

.aad-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #E2E8F0;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.aad-step-indicator.active .aad-step-num {
  background: #12263F;
  color: #ffffff;
}

.aad-step-indicator.completed .aad-step-num {
  background: #059669;
  color: #ffffff;
}

/* Body */
.aad-quote-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.aad-quote-section {
  display: none;
}
.aad-quote-section.active {
  display: block;
}

.aad-service-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #e2e8f0;
  color: #12263F;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.aad-step-heading {
  font-size: 18px;
  font-weight: 700;
  color: #12263F;
  margin: 0 0 6px 0;
}

.aad-step-subheading {
  font-size: 13px;
  color: #64748B;
  margin: 0 0 20px 0;
  line-height: 1.5;
}

/* Service Selector Cards */
.aad-service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  max-height: 350px;
  overflow-y: auto;
  padding-right: 4px;
}

.aad-service-card {
  border: 2px solid #E2E8F0;
  border-radius: 6px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #ffffff;
}

.aad-service-card:hover {
  border-color: #12263F;
}

.aad-service-card.selected {
  border-color: #12263F;
  background-color: #f1f5f9;
  box-shadow: 0 0 0 1px #12263F;
}

.aad-service-card img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

.aad-service-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #12263F;
  line-height: 1.3;
}

/* Form Controls */
.aad-form-field {
  margin-bottom: 16px;
}

.aad-field-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #1E293B;
  margin-bottom: 6px;
}

.aad-input, .aad-select, .aad-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  box-sizing: border-box;
  font-family: inherit;
  color: #0F172A;
  background-color: #ffffff;
  transition: border-color 0.15s ease;
}

.aad-input:focus, .aad-select:focus, .aad-textarea:focus {
  outline: none;
  border-color: #12263F;
  box-shadow: 0 0 0 2px rgba(18, 38, 63, 0.15);
}

.aad-textarea {
  min-height: 80px;
  resize: vertical;
}

/* Radio / Checkbox Cards */
.aad-choice-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.aad-choice-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #1E293B;
  background: #ffffff;
  transition: border-color 0.15s ease;
}

.aad-choice-item:hover {
  border-color: #12263F;
}

.aad-choice-item input {
  accent-color: #12263F;
  margin: 0;
  width: 16px;
  height: 16px;
}

/* Dimension Row */
.aad-dim-row {
  display: grid;
  grid-template-columns: 1fr 1fr 100px;
  gap: 12px;
  margin-bottom: 12px;
}

/* Error Notice */
.aad-error-notice {
  background: #FEE2E2;
  border: 1px solid #EF4444;
  color: #991B1B;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

/* Footer Buttons */
.aad-quote-footer {
  padding: 14px 24px;
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Success View */
.aad-success-box {
  text-align: center;
  padding: 30px 10px;
}

.aad-ref-display {
  font-size: 26px;
  font-weight: 800;
  color: #12263F;
  background: #f1f5f9;
  padding: 12px 24px;
  border-radius: 6px;
  display: inline-block;
  letter-spacing: 0.05em;
  border: 2px dashed #12263F;
  margin: 16px 0;
}

@media (max-width: 640px) {
  .aad-quote-window {
    max-height: 100vh;
    height: 100%;
    border-radius: 0;
  }
  .aad-dim-row {
    grid-template-columns: 1fr;
  }
  .aad-service-grid {
    grid-template-columns: 1fr;
  }
}
