/* ==========================================================================
   COMPONENTS — Piezas reutilizables: botones, tarjetas, formularios, FAQ
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Botones
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn-primary {
  background: var(--amarillo);
  color: var(--azul-950);
}

.btn-primary:hover {
  background: var(--amarillo-hover);
  transform: translateY(-1px);
}

.btn-primary[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  background: transparent;
  border-color: var(--blanco);
  color: var(--blanco);
}

.btn-outline:hover {
  background: var(--blanco);
  color: var(--azul-950);
}

.btn-outline-dark {
  background: transparent;
  border-color: var(--azul-900);
  color: var(--azul-900);
}

.btn-outline-dark:hover {
  background: var(--azul-900);
  color: var(--blanco);
}

/* --------------------------------------------------------------------------
   2. Tarjeta de servicio
   -------------------------------------------------------------------------- */
.card {
  background: var(--blanco);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
}

.card-img {
  height: 160px;
  overflow: hidden;
  background: var(--azul-800);
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 2px;
}

.card-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--azul-900);
  color: var(--blanco);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.card-body h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--azul-950);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.card-body p {
  font-size: 13.5px;
  color: var(--gris-700);
  margin-bottom: 14px;
  flex: 1;
}

.card-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--amarillo-hover);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.card-link:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   3. Formulario
   -------------------------------------------------------------------------- */
.form-card {
  background: var(--blanco);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.form-card h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--azul-950);
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (min-width: 520px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gris-700);
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--gris-300);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--texto);
  background: var(--blanco);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--azul-700);
  box-shadow: 0 0 0 3px rgba(27, 78, 158, 0.12);
}

.field input:user-invalid,
.field textarea:user-invalid {
  border-color: #d64545;
}

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

.field-full {
  grid-column: 1 / -1;
}

.field-mensaje {
  margin-bottom: 18px;
}

.form-card .btn-primary {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
}

/* Honeypot anti-spam: invisible para personas, visible para bots */
.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

.form-status {
  margin-top: 14px;
  font-size: 13.5px;
  font-weight: 600;
  min-height: 20px;
}

.form-status[data-state="ok"] {
  color: #1f7a4d;
}

.form-status[data-state="error"] {
  color: #d64545;
}

.form-legal {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--gris-500);
  line-height: 1.5;
}

.form-legal a {
  color: var(--azul-700);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   4. Acordeón de preguntas frecuentes (soporte de rich results FAQ)
   -------------------------------------------------------------------------- */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.faq-item {
  background: var(--blanco);
  border: 1px solid var(--gris-300);
  border-radius: var(--radius);
  padding: 18px 22px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  color: var(--azul-950);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 22px;
  font-weight: 400;
  color: var(--amarillo-hover);
  flex: 0 0 auto;
}

.faq-item[open] summary::after {
  content: "\2013";
}

.faq-item p {
  margin-top: 12px;
  font-size: 14px;
  color: var(--gris-700);
}

/* --------------------------------------------------------------------------
   5. Botón flotante de WhatsApp (conversión / SEM)
   -------------------------------------------------------------------------- */
.whatsapp-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: var(--z-float);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #25d366;
  color: var(--blanco);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

.whatsapp-float:hover {
  transform: scale(1.08);
}

.whatsapp-float svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

/* --------------------------------------------------------------------------
   6. Modal (pop-up de detalle de servicios)
   -------------------------------------------------------------------------- */
.modal {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  max-width: 560px;
  width: calc(100% - 32px);
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  color: var(--texto);
  box-shadow: var(--shadow-lg);
  position: fixed;
  inset: 50% auto auto 50%;
  margin: 0;
  transform: translate(-50%, -50%);
}

.modal[open] {
  display: flex;
  flex-direction: column;
}

.modal::backdrop {
  background: rgba(11, 30, 74, 0.55);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 30px;
  line-height: 1;
  color: var(--gris-700);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  color: var(--azul-800);
  background: var(--gris-100);
}

.modal-title {
  flex: 0 0 auto;
  padding: 28px 32px 8px;
  color: var(--azul-800);
  font-size: 22px;
  font-weight: 800;
}

.modal-scroll-area {
  position: relative;
  display: flex;
  min-height: 0;
  max-height: min(56dvh, 460px);
}

.modal-body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: 8px 48px 20px 32px;
  color: var(--gris-700);
  font-size: 15px;
  line-height: 1.6;
}

.modal-body::-webkit-scrollbar {
  display: none;
}

.modal-scrollbar {
  position: absolute;
  top: 8px;
  right: 14px;
  bottom: 20px;
  width: 9px;
  background: var(--gris-100);
  border-radius: 999px;
}

.modal-scrollbar[hidden] {
  display: none;
}

.modal-scrollbar-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 36px;
  background: var(--azul-700);
  border-radius: 999px;
  cursor: grab;
  touch-action: none;
}

.modal-scrollbar-thumb:hover {
  background: var(--azul-900);
}

.modal-scrollbar-thumb:active {
  cursor: grabbing;
}

.modal-body p {
  margin-bottom: 12px;
}

.modal-body h3 {
  margin: 18px 0 4px;
  color: var(--azul-800);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.modal-body ul {
  margin-top: 8px;
  padding-left: 20px;
  list-style: disc;
}

.modal-body li {
  margin-bottom: 6px;
}

.modal-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 32px 28px;
}
