/* ============================================
   COMPONENTS - Fixed Contact CTA
   ============================================ */

/* Fixed CTA Button */
.fixed-contact-cta {
  position: fixed;
  right: 24px;
  bottom: 150px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--brand-orange);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(26, 67, 191, 0.4),
              0 0 0 0 rgba(26, 67, 191, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(0);
  will-change: transform, box-shadow;
}

.fixed-contact-cta.is-hidden {
  display: none !important;
  visibility: hidden !important;
}

/* Fixed Close Button (replaces CTA when form is open) */
.fixed-contact-close {
  position: fixed;
  right: 24px;
  bottom: 150px;
  z-index: 999;
  display: none;
  visibility: hidden;
  opacity: 0;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  background: var(--brand-orange);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.4),
              0 0 0 0 rgba(249, 115, 22, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(0);
  will-change: transform, box-shadow;
  pointer-events: none;
}

.fixed-contact-close.is-visible {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.fixed-contact-close.is-hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.fixed-contact-close:hover {
  transform: translateY(-2px) rotate(90deg);
  box-shadow: 0 6px 28px rgba(249, 115, 22, 0.5),
              0 0 0 4px rgba(249, 115, 22, 0.15);
  background:var(--brand-blue);
  color: var(--bg);
}

.fixed-contact-close:active {
  transform: translateY(0) rotate(90deg);
}

.fixed-contact-close svg {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.fixed-contact-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(26, 67, 191, 0.5),
              0 0 0 4px rgba(26, 67, 191, 0.15);
  background: var(--brand-blue)!important;
  color: var(--bg);
}

.fixed-contact-cta:active {
  transform: translateY(0);
}

.fixed-contact-cta[aria-expanded="true"] {
  background: var(--brand-orange);
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.4),
              0 0 0 0 rgba(249, 115, 22, 0.2);
}

.fixed-contact-cta[aria-expanded="true"]:hover {
  box-shadow: 0 6px 28px rgba(249, 115, 22, 0.5),
              0 0 0 4px rgba(249, 115, 22, 0.15);
}

.fixed-cta-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.fixed-cta-icon svg {
  width: 100%;
  height: 100%;
}

.fixed-cta-text {
  white-space: nowrap;
}

/* Horizontal Form Bar */
.horizontal-contact-form {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 998;
  background: var(--bg);
  border-top: 1px solid var(--stroke);
  box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.15);
  transform: translateY(100%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
              opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1),
              visibility 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: transform, opacity;
}

.horizontal-contact-form.is-visible {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.horizontal-form-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 24px;
  position: relative;
}

.horizontal-form-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.horizontal-form-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.horizontal-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.horizontal-form-group-visit-date {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.horizontal-form-group-visit-date[style*="display: block"] {
  opacity: 1;
  transform: translateY(0);
}

.horizontal-form-input,
.horizontal-form-select {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stroke);
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.horizontal-form-input:focus,
.horizontal-form-select:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(26, 67, 191, 0.1);
}

.horizontal-form-input::placeholder {
  color: var(--muted);
}

.horizontal-form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23334155' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.horizontal-form-submit {
  grid-column: -1;
}

.horizontal-form-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--brand-blue);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-height: 44px;
}

.horizontal-form-submit-btn:hover:not(:disabled) {
  background: var(--brand-2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 67, 191, 0.3);
  color: var(--bg);
}

.horizontal-form-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.horizontal-form-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.horizontal-form-submit-btn.is-loading {
  position: relative;
  color: transparent;
}

.horizontal-form-submit-btn.is-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.horizontal-form-submit-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.horizontal-form-status {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  min-height: 20px;
}

.horizontal-form-status.status-success {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.horizontal-form-status.status-error {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .fixed-contact-cta {
    right: 16px;
    bottom: 26px;
    padding: 12px 18px;
    font-size: 14px;
  }

  .fixed-contact-close {
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
  }

  .fixed-contact-close svg {
    width: 20px;
    height: 20px;
  }

  .fixed-cta-text {
    display: none;
  }

  .fixed-cta-icon {
    width: 20px;
    height: 20px;
  }

  .horizontal-form-container {
    padding: 16px;
  }

  .horizontal-form-fields {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .horizontal-form-submit {
    grid-column: 1;
  }

  .horizontal-form-close {
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 480px) {
  .fixed-contact-cta {
    right: 12px;
    bottom: 120px;
    padding: 15px 20px;
  }

  .fixed-contact-close {
    right: 12px;
    bottom: 12px;
    width: 40px;
    height: 40px;
  }

  .fixed-contact-close svg {
    width: 18px;
    height: 18px;
  }

  .horizontal-form-container {
    padding: 14px;
  }

  .horizontal-form-input,
  .horizontal-form-select {
    padding: 10px 14px;
    font-size: 13px;
  }

  .horizontal-form-submit-btn {
    padding: 10px 20px;
    font-size: 13px;
    min-height: 40px;
  }
}
