/* ===== FAB + CONTACT MODAL + BOTTOM SHEET ===== */

.fab-chat {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--paper);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.45);
  z-index: 100;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.fab-chat:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(217, 119, 6, 0.55);
}
.fab-chat svg { width: 24px; height: 24px; }

@media (max-width: 720px) {
  .fab-chat {
    bottom: 24px !important;
    right: 24px !important;
    width: 52px !important;
    height: 52px !important;
  }
  .fab-chat svg { width: 22px !important; height: 22px !important; }
}

/* Contact modal — desktop slide-in */
.contact-modal-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 460px;
  z-index: 200;
  background: transparent;
  pointer-events: none;
  display: flex;
  align-items: center;
  padding: 24px;
  padding-right: 96px;
}
.contact-modal-backdrop.open { pointer-events: auto; }

.contact-modal {
  background: var(--paper);
  width: 100%;
  max-width: 420px;
  padding: 32px 30px 28px;
  position: relative;
  transform: translateX(calc(100% + 96px));
  transition: transform 0.45s var(--ease);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border-radius: 12px;
  box-shadow:
    -16px 24px 60px rgba(20, 42, 71, 0.22),
    0 2px 8px rgba(20, 42, 71, 0.08);
  border: 1px solid var(--line);
  pointer-events: auto;
}
.contact-modal-backdrop.open .contact-modal { transform: translateX(0); }

.contact-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  transition: all 0.3s var(--ease);
}
.contact-modal-close:hover {
  color: var(--navy);
  border-color: var(--navy);
  background: var(--bone);
}

.contact-modal h3 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  padding-right: 40px;
}
.contact-modal-sub {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  line-height: 1.45;
}

.contact-form-modal {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.contact-form-modal .form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.contact-form-modal .field label {
  display: block;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 6px;
}
.contact-form-modal input,
.contact-form-modal select,
.contact-form-modal textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--navy);
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  border-radius: 4px;
}
.contact-form-modal input::placeholder,
.contact-form-modal textarea::placeholder {
  color: rgba(20, 42, 71, 0.35);
}
.contact-form-modal input:focus,
.contact-form-modal select:focus,
.contact-form-modal textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.12);
}
.contact-form-modal textarea { resize: vertical; min-height: 88px; }

/* ===== Estado inválido + mensaje de error ===== */
.contact-form-modal input.is-invalid,
.contact-form-modal select.is-invalid,
.contact-form-modal textarea.is-invalid {
  border-color: #c0392b;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}
.contact-form-modal input.is-invalid:focus,
.contact-form-modal select.is-invalid:focus,
.contact-form-modal textarea.is-invalid:focus {
  border-color: #c0392b;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.22);
}
.contact-form-modal .field-error {
  display: block;
  min-height: 0;
  margin-top: 5px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  color: #c0392b;
  letter-spacing: 0.01em;
}
.contact-form-modal .field-error:empty { display: none; }

.contact-form-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  background: var(--orange);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  margin-top: 8px;
  position: relative;
  overflow: hidden;
  animation: contactBtnPulse 2.4s ease-in-out infinite;
}
.contact-form-submit:hover {
  background: var(--orange-light);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(217, 119, 6, 0.32);
}
.contact-form-submit svg { width: 16px; height: 16px; }

@keyframes contactBtnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.55); }
  50%      { box-shadow: 0 0 0 10px rgba(217, 119, 6, 0); }
}

/* Bottom sheet mobile */
@media (max-width: 720px) {
  .contact-modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    background: rgba(13, 28, 48, 0.55) !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease);
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
    z-index: 250 !important;
  }
  .contact-modal-backdrop.open { opacity: 1; pointer-events: auto; }
  .contact-modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 88vh !important;
    border-radius: 20px 20px 0 0 !important;
    padding: 32px 22px 28px !important;
    transform: translateY(100%) !important;
    transition: transform 0.42s var(--ease) !important;
    box-shadow: 0 -16px 40px rgba(20, 42, 71, 0.28) !important;
    overflow-y: auto;
    margin: 0 !important;
  }
  .contact-modal::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 4px;
    background: rgba(20, 42, 71, 0.18);
    border-radius: 2px;
    pointer-events: none;
  }
  .contact-modal-backdrop.open .contact-modal { transform: translateY(0) !important; }
  .contact-modal-close { top: 14px !important; right: 14px !important; }
  .contact-modal h3 { font-size: 22px !important; margin-bottom: 10px !important; }
  .contact-modal-sub { margin-bottom: 28px !important; padding-bottom: 22px !important; }
  .contact-form-modal { gap: 20px !important; }
  .contact-form-modal .form-grid-2 { gap: 18px !important; grid-template-columns: 1fr; }
  .contact-form-modal .field label { margin-bottom: 8px !important; }
  .contact-form-modal input,
  .contact-form-modal select,
  .contact-form-modal textarea {
    padding: 14px 14px !important;
    font-size: 15px !important;
  }
}
